home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-1.iso / Files / System 7 / Frontier / Frontier SDK 2.1.sit / Frontier SDK 2.1 / Toolkits / Applet Toolkit / appletfiles.c < prev    next >
MacBinary  |  1993-06-09  |  13.8 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Wed Jun 9 10:02:41 1993, modified Wed Jun 9 10:02:41 1993, creator Think C, type ASCII, 13408 bytes "appletfiles.c" , at 0x34e0 462 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0d 61 70 70 6c 65 74 | 66 69 6c 65 73 2e 63 00 |..applet|files.c.|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 34 60 00 | 00 01 ce a8 3b 9e 01 a8 |.....4`.|....;...|
|00000060| 3b 9e 01 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |;.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 4b a2 00 00 |........|....K...|
|00000080| 0d 2f 2a a9 20 43 6f 70 | 79 72 69 67 68 74 20 31 |./*. Cop|yright 1|
|00000090| 39 38 38 2d 31 39 39 32 | 20 55 73 65 72 4c 61 6e |988-1992| UserLan|
|000000a0| 64 20 53 6f 66 74 77 61 | 72 65 2c 20 49 6e 63 2e |d Softwa|re, Inc.|
|000000b0| 20 20 41 6c 6c 20 52 69 | 67 68 74 73 20 52 65 73 | All Ri|ghts Res|
|000000c0| 65 72 76 65 64 2e 2a 2f | 0d 0d 0d 23 69 6e 63 6c |erved.*/|...#incl|
|000000d0| 75 64 65 20 22 61 70 70 | 6c 65 74 6f 70 73 2e 68 |ude "app|letops.h|
|000000e0| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 61 70 70 6c |".#inclu|de "appl|
|000000f0| 65 74 73 74 72 69 6e 67 | 73 2e 68 22 0d 23 69 6e |etstring|s.h".#in|
|00000100| 63 6c 75 64 65 20 22 61 | 70 70 6c 65 74 6d 65 6d |clude "a|ppletmem|
|00000110| 6f 72 79 2e 68 22 0d 23 | 69 6e 63 6c 75 64 65 20 |ory.h".#|include |
|00000120| 22 61 70 70 6c 65 74 63 | 75 72 73 6f 72 2e 68 22 |"appletc|ursor.h"|
|00000130| 0d 23 69 6e 63 6c 75 64 | 65 20 22 61 70 70 6c 65 |.#includ|e "apple|
|00000140| 74 64 69 61 6c 6f 67 73 | 2e 68 22 0d 23 69 6e 63 |tdialogs|.h".#inc|
|00000150| 6c 75 64 65 20 22 61 70 | 70 6c 65 74 66 69 6c 65 |lude "ap|pletfile|
|00000160| 73 2e 68 22 0d 0d 0d 73 | 74 61 74 69 63 20 62 6f |s.h"...s|tatic bo|
|00000170| 6f 6c 65 61 6e 20 66 6f | 6c 64 65 72 74 65 73 74 |olean fo|ldertest|
|00000180| 20 28 43 49 6e 66 6f 50 | 42 52 65 63 20 2a 70 62 | (CInfoP|BRec *pb|
|00000190| 29 20 7b 0d 09 0d 09 2f | 2a 0d 09 72 65 74 75 72 |) {..../|*..retur|
|000001a0| 6e 20 74 72 75 65 20 69 | 66 20 70 62 20 68 6f 6c |n true i|f pb hol|
|000001b0| 64 73 20 69 6e 66 6f 20 | 64 65 73 63 72 69 62 69 |ds info |describi|
|000001c0| 6e 67 20 61 20 66 6f 6c | 64 65 72 2e 0d 09 2a 2f |ng a fol|der...*/|
|000001d0| 0d 09 0d 09 72 65 74 75 | 72 6e 20 28 42 69 74 54 |....retu|rn (BitT|
|000001e0| 73 74 20 28 26 70 62 2d | 3e 64 69 72 49 6e 66 6f |st (&pb-|>dirInfo|
|000001f0| 2e 69 6f 46 6c 41 74 74 | 72 69 62 2c 20 33 29 29 |.ioFlAtt|rib, 3))|
|00000200| 3b 0d 09 7d 20 2f 2a 66 | 6f 6c 64 65 72 74 65 73 |;..} /*f|oldertes|
|00000210| 74 2a 2f 0d 0d 0d 73 74 | 61 74 69 63 20 62 6f 6f |t*/...st|atic boo|
|00000220| 6c 65 61 6e 20 67 65 74 | 69 6e 66 6f 66 72 6f 6d |lean get|infofrom|
|00000230| 70 62 20 28 43 49 6e 66 | 6f 50 42 52 65 63 20 2a |pb (CInf|oPBRec *|
|00000240| 70 70 62 2c 20 74 79 66 | 69 6c 65 69 6e 66 6f 20 |ppb, tyf|ileinfo |
|00000250| 2a 69 6e 66 6f 29 20 7b | 0d 09 0d 09 43 49 6e 66 |*info) {|....CInf|
|00000260| 6f 50 42 52 65 63 20 70 | 62 20 3d 20 2a 70 70 62 |oPBRec p|b = *ppb|
|00000270| 3b 0d 09 62 6f 6f 6c 65 | 61 6e 20 66 6c 66 6f 6c |;..boole|an flfol|
|00000280| 64 65 72 3b 0d 09 0d 09 | 28 2a 69 6e 66 6f 29 2e |der;....|(*info).|
|00000290| 66 6c 6c 6f 63 6b 65 64 | 20 3d 20 42 69 74 54 73 |fllocked| = BitTs|
|000002a0| 74 20 28 26 70 62 2e 64 | 69 72 49 6e 66 6f 2e 69 |t (&pb.d|irInfo.i|
|000002b0| 6f 46 6c 41 74 74 72 69 | 62 2c 20 37 29 3b 0d 09 |oFlAttri|b, 7);..|
|000002c0| 0d 09 66 6c 66 6f 6c 64 | 65 72 20 3d 20 28 2a 69 |..flfold|er = (*i|
|000002d0| 6e 66 6f 29 2e 66 6c 66 | 6f 6c 64 65 72 20 3d 20 |nfo).flf|older = |
|000002e0| 66 6f 6c 64 65 72 74 65 | 73 74 20 28 26 70 62 29 |folderte|st (&pb)|
|000002f0| 3b 0d 09 0d 09 69 66 20 | 28 66 6c 66 6f 6c 64 65 |;....if |(flfolde|
|00000300| 72 29 20 7b 0d 09 09 0d | 09 09 28 2a 69 6e 66 6f |r) {....|..(*info|
|00000310| 29 2e 66 6c 62 75 73 79 | 20 3d 20 70 62 2e 64 69 |).flbusy| = pb.di|
|00000320| 72 49 6e 66 6f 2e 69 6f | 44 72 4e 6d 46 6c 73 20 |rInfo.io|DrNmFls |
|00000330| 3e 20 30 3b 0d 09 09 0d | 09 09 28 2a 69 6e 66 6f |> 0;....|..(*info|
|00000340| 29 2e 66 69 6c 65 63 72 | 65 61 74 6f 72 20 3d 20 |).filecr|eator = |
|00000350| 28 2a 69 6e 66 6f 29 2e | 66 69 6c 65 74 79 70 65 |(*info).|filetype|
|00000360| 20 3d 20 27 20 20 20 20 | 27 3b 0d 09 09 0d 09 09 | = ' |';......|
|00000370| 28 2a 69 6e 66 6f 29 2e | 74 69 6d 65 63 72 65 61 |(*info).|timecrea|
|00000380| 74 65 64 20 3d 20 70 62 | 2e 64 69 72 49 6e 66 6f |ted = pb|.dirInfo|
|00000390| 2e 69 6f 44 72 43 72 44 | 61 74 3b 0d 0d 09 09 28 |.ioDrCrD|at;....(|
|000003a0| 2a 69 6e 66 6f 29 2e 74 | 69 6d 65 6d 6f 64 69 66 |*info).t|imemodif|
|000003b0| 69 65 64 20 3d 20 70 62 | 2e 64 69 72 49 6e 66 6f |ied = pb|.dirInfo|
|000003c0| 2e 69 6f 44 72 4d 64 44 | 61 74 3b 0d 09 09 0d 09 |.ioDrMdD|at;.....|
|000003d0| 09 28 2a 69 6e 66 6f 29 | 2e 69 63 6f 6e 70 6f 73 |.(*info)|.iconpos|
|000003e0| 69 74 69 6f 6e 20 3d 20 | 70 62 2e 64 69 72 49 6e |ition = |pb.dirIn|
|000003f0| 66 6f 2e 69 6f 44 72 55 | 73 72 57 64 73 2e 66 72 |fo.ioDrU|srWds.fr|
|00000400| 4c 6f 63 61 74 69 6f 6e | 3b 0d 09 09 7d 0d 09 09 |Location|;...}...|
|00000410| 0d 09 65 6c 73 65 20 7b | 20 2f 2a 66 69 6c 6c 20 |..else {| /*fill |
|00000420| 69 6e 20 66 69 65 6c 64 | 73 20 66 6f 72 20 61 20 |in field|s for a |
|00000430| 66 69 6c 65 2c 20 73 6f | 6d 65 77 68 61 74 20 64 |file, so|mewhat d|
|00000440| 69 66 66 65 72 65 6e 74 | 20 66 6f 72 6d 61 74 20 |ifferent| format |
|00000450| 74 68 61 6e 20 61 20 66 | 6f 6c 64 65 72 2a 2f 0d |than a f|older*/.|
|00000460| 09 0d 09 09 28 2a 69 6e | 66 6f 29 2e 66 6c 62 75 |....(*in|fo).flbu|
|00000470| 73 79 20 3d 20 42 69 74 | 54 73 74 20 28 26 70 62 |sy = Bit|Tst (&pb|
|00000480| 2e 68 46 69 6c 65 49 6e | 66 6f 2e 69 6f 46 6c 41 |.hFileIn|fo.ioFlA|
|00000490| 74 74 72 69 62 2c 20 30 | 29 3b 0d 09 09 0d 09 09 |ttrib, 0|);......|
|000004a0| 28 2a 69 6e 66 6f 29 2e | 66 6c 62 75 6e 64 6c 65 |(*info).|flbundle|
|000004b0| 20 3d 20 28 70 62 2e 68 | 46 69 6c 65 49 6e 66 6f | = (pb.h|FileInfo|
|000004c0| 2e 69 6f 46 6c 46 6e 64 | 72 49 6e 66 6f 2e 66 64 |.ioFlFnd|rInfo.fd|
|000004d0| 46 6c 61 67 73 20 26 20 | 30 78 32 30 30 30 29 20 |Flags & |0x2000) |
|000004e0| 21 3d 20 30 3b 0d 09 09 | 0d 09 09 28 2a 69 6e 66 |!= 0;...|...(*inf|
|000004f0| 6f 29 2e 66 6c 69 6e 76 | 69 73 69 62 6c 65 20 3d |o).flinv|isible =|
|00000500| 20 28 70 62 2e 68 46 69 | 6c 65 49 6e 66 6f 2e 69 | (pb.hFi|leInfo.i|
|00000510| 6f 46 6c 46 6e 64 72 49 | 6e 66 6f 2e 66 64 46 6c |oFlFndrI|nfo.fdFl|
|00000520| 61 67 73 20 26 20 30 78 | 34 30 30 30 29 20 21 3d |ags & 0x|4000) !=|
|00000530| 20 30 3b 0d 09 09 0d 09 | 09 28 2a 69 6e 66 6f 29 | 0;.....|.(*info)|
|00000540| 2e 66 6c 61 6c 69 61 73 | 20 3d 20 28 70 62 2e 68 |.flalias| = (pb.h|
|00000550| 46 69 6c 65 49 6e 66 6f | 2e 69 6f 46 6c 46 6e 64 |FileInfo|.ioFlFnd|
|00000560| 72 49 6e 66 6f 2e 66 64 | 46 6c 61 67 73 20 26 20 |rInfo.fd|Flags & |
|00000570| 30 78 38 30 30 30 29 20 | 21 3d 20 30 3b 0d 09 09 |0x8000) |!= 0;...|
|00000580| 0d 09 09 28 2a 69 6e 66 | 6f 29 2e 66 69 6c 65 63 |...(*inf|o).filec|
|00000590| 72 65 61 74 6f 72 20 3d | 20 70 62 2e 68 46 69 6c |reator =| pb.hFil|
|000005a0| 65 49 6e 66 6f 2e 69 6f | 46 6c 46 6e 64 72 49 6e |eInfo.io|FlFndrIn|
|000005b0| 66 6f 2e 66 64 43 72 65 | 61 74 6f 72 3b 0d 09 09 |fo.fdCre|ator;...|
|000005c0| 0d 09 09 28 2a 69 6e 66 | 6f 29 2e 66 69 6c 65 74 |...(*inf|o).filet|
|000005d0| 79 70 65 20 3d 20 70 62 | 2e 68 46 69 6c 65 49 6e |ype = pb|.hFileIn|
|000005e0| 66 6f 2e 69 6f 46 6c 46 | 6e 64 72 49 6e 66 6f 2e |fo.ioFlF|ndrInfo.|
|000005f0| 66 64 54 79 70 65 3b 0d | 09 09 0d 09 09 28 2a 69 |fdType;.|.....(*i|
|00000600| 6e 66 6f 29 2e 74 69 6d | 65 63 72 65 61 74 65 64 |nfo).tim|ecreated|
|00000610| 20 3d 20 70 62 2e 68 46 | 69 6c 65 49 6e 66 6f 2e | = pb.hF|ileInfo.|
|00000620| 69 6f 46 6c 43 72 44 61 | 74 3b 0d 0d 09 09 28 2a |ioFlCrDa|t;....(*|
|00000630| 69 6e 66 6f 29 2e 74 69 | 6d 65 6d 6f 64 69 66 69 |info).ti|memodifi|
|00000640| 65 64 20 3d 20 70 62 2e | 68 46 69 6c 65 49 6e 66 |ed = pb.|hFileInf|
|00000650| 6f 2e 69 6f 46 6c 4d 64 | 44 61 74 3b 0d 09 09 0d |o.ioFlMd|Dat;....|
|00000660| 09 09 28 2a 69 6e 66 6f | 29 2e 73 69 7a 65 64 61 |..(*info|).sizeda|
|00000670| 74 61 66 6f 72 6b 20 3d | 20 70 62 2e 68 46 69 6c |tafork =| pb.hFil|
|00000680| 65 49 6e 66 6f 2e 69 6f | 46 6c 4c 67 4c 65 6e 3b |eInfo.io|FlLgLen;|
|00000690| 0d 09 09 0d 09 09 28 2a | 69 6e 66 6f 29 2e 73 69 |......(*|info).si|
|000006a0| 7a 65 72 65 73 6f 75 72 | 63 65 66 6f 72 6b 20 3d |zeresour|cefork =|
|000006b0| 20 70 62 2e 68 46 69 6c | 65 49 6e 66 6f 2e 69 6f | pb.hFil|eInfo.io|
|000006c0| 46 6c 52 4c 67 4c 65 6e | 3b 0d 09 09 0d 09 09 28 |FlRLgLen|;......(|
|000006d0| 2a 69 6e 66 6f 29 2e 69 | 63 6f 6e 70 6f 73 69 74 |*info).i|conposit|
|000006e0| 69 6f 6e 20 3d 20 70 62 | 2e 68 46 69 6c 65 49 6e |ion = pb|.hFileIn|
|000006f0| 66 6f 2e 69 6f 46 6c 46 | 6e 64 72 49 6e 66 6f 2e |fo.ioFlF|ndrInfo.|
|00000700| 66 64 4c 6f 63 61 74 69 | 6f 6e 3b 0d 09 09 7d 0d |fdLocati|on;...}.|
|00000710| 09 0d 09 28 2a 69 6e 66 | 6f 29 2e 69 78 6c 61 62 |...(*inf|o).ixlab|
|00000720| 65 6c 20 3d 20 28 70 62 | 2e 68 46 69 6c 65 49 6e |el = (pb|.hFileIn|
|00000730| 66 6f 2e 69 6f 46 6c 46 | 6e 64 72 49 6e 66 6f 2e |fo.ioFlF|ndrInfo.|
|00000740| 66 64 46 6c 61 67 73 20 | 26 20 30 78 30 30 30 45 |fdFlags |& 0x000E|
|00000750| 29 20 3e 3e 20 31 3b 0d | 09 0d 09 72 65 74 75 72 |) >> 1;.|...retur|
|00000760| 6e 20 28 74 72 75 65 29 | 3b 0d 09 7d 20 2f 2a 67 |n (true)|;..} /*g|
|00000770| 65 74 69 6e 66 6f 66 72 | 6f 6d 70 62 2a 2f 0d 09 |etinfofr|ompb*/..|
|00000780| 0d 09 0d 62 6f 6f 6c 65 | 61 6e 20 66 69 6c 65 67 |...boole|an fileg|
|00000790| 65 74 69 6e 66 6f 20 28 | 62 69 67 73 74 72 69 6e |etinfo (|bigstrin|
|000007a0| 67 20 66 6e 61 6d 65 2c | 20 73 68 6f 72 74 20 76 |g fname,| short v|
|000007b0| 6e 75 6d 2c 20 74 79 66 | 69 6c 65 69 6e 66 6f 20 |num, tyf|ileinfo |
|000007c0| 2a 69 6e 66 6f 29 20 7b | 0d 09 0d 09 43 49 6e 66 |*info) {|....CInf|
|000007d0| 6f 50 42 52 65 63 20 70 | 62 3b 0d 09 0d 09 63 6c |oPBRec p|b;....cl|
|000007e0| 65 61 72 62 79 74 65 73 | 20 28 26 70 62 2c 20 6c |earbytes| (&pb, l|
|000007f0| 6f 6e 67 73 69 7a 65 6f | 66 20 28 70 62 29 29 3b |ongsizeo|f (pb));|
|00000800| 20 2f 2a 69 6e 69 74 20 | 61 6c 6c 20 66 69 65 6c | /*init |all fiel|
|00000810| 64 73 20 74 6f 20 7a 65 | 72 6f 2a 2f 0d 09 0d 09 |ds to ze|ro*/....|
|00000820| 70 62 2e 68 46 69 6c 65 | 49 6e 66 6f 2e 69 6f 4e |pb.hFile|Info.ioN|
|00000830| 61 6d 65 50 74 72 20 3d | 20 66 6e 61 6d 65 3b 0d |amePtr =| fname;.|
|00000840| 0d 09 70 62 2e 68 46 69 | 6c 65 49 6e 66 6f 2e 69 |..pb.hFi|leInfo.i|
|00000850| 6f 56 52 65 66 4e 75 6d | 20 3d 20 76 6e 75 6d 3b |oVRefNum| = vnum;|
|00000860| 0d 09 0d 09 28 2a 69 6e | 66 6f 29 2e 65 72 72 63 |....(*in|fo).errc|
|00000870| 6f 64 65 20 3d 20 50 42 | 47 65 74 43 61 74 49 6e |ode = PB|GetCatIn|
|00000880| 66 6f 20 28 26 70 62 2c | 20 66 61 6c 73 65 29 3b |fo (&pb,| false);|
|00000890| 0d 09 0d 09 69 66 20 28 | 28 2a 69 6e 66 6f 29 2e |....if (|(*info).|
|000008a0| 65 72 72 63 6f 64 65 20 | 21 3d 20 6e 6f 45 72 72 |errcode |!= noErr|
|000008b0| 29 0d 09 09 72 65 74 75 | 72 6e 20 28 66 61 6c 73 |)...retu|rn (fals|
|000008c0| 65 29 3b 0d 09 09 0d 09 | 63 6c 65 61 72 62 79 74 |e);.....|clearbyt|
|000008d0| 65 73 20 28 69 6e 66 6f | 2c 20 6c 6f 6e 67 73 69 |es (info|, longsi|
|000008e0| 7a 65 6f 66 20 28 74 79 | 66 69 6c 65 69 6e 66 6f |zeof (ty|fileinfo|
|000008f0| 29 29 3b 20 2f 2a 69 6e | 69 74 20 61 6c 6c 20 66 |)); /*in|it all f|
|00000900| 69 65 6c 64 73 20 74 6f | 20 7a 65 72 6f 2a 2f 0d |ields to| zero*/.|
|00000910| 09 0d 09 63 6f 70 79 73 | 74 72 69 6e 67 20 28 66 |...copys|tring (f|
|00000920| 6e 61 6d 65 2c 20 28 2a | 69 6e 66 6f 29 2e 66 6e |name, (*|info).fn|
|00000930| 61 6d 65 29 3b 0d 09 0d | 09 67 65 74 69 6e 66 6f |ame);...|.getinfo|
|00000940| 66 72 6f 6d 70 62 20 28 | 26 70 62 2c 20 69 6e 66 |frompb (|&pb, inf|
|00000950| 6f 29 3b 0d 09 0d 09 72 | 65 74 75 72 6e 20 28 74 |o);....r|eturn (t|
|00000960| 72 75 65 29 3b 0d 09 7d | 20 2f 2a 66 69 6c 65 67 |rue);..}| /*fileg|
|00000970| 65 74 69 6e 66 6f 2a 2f | 0d 09 0d 09 0d 62 6f 6f |etinfo*/|.....boo|
|00000980| 6c 65 61 6e 20 66 69 6c | 65 64 65 6c 65 74 65 20 |lean fil|edelete |
|00000990| 28 62 69 67 73 74 72 69 | 6e 67 20 62 73 70 61 74 |(bigstri|ng bspat|
|000009a0| 68 2c 20 73 68 6f 72 74 | 20 76 6e 75 6d 29 20 7b |h, short| vnum) {|
|000009b0| 0d 0d 09 48 50 61 72 61 | 6d 42 6c 6f 63 6b 52 65 |...HPara|mBlockRe|
|000009c0| 63 20 70 62 3b 0d 09 0d | 09 63 6c 65 61 72 62 79 |c pb;...|.clearby|
|000009d0| 74 65 73 20 28 26 70 62 | 2c 20 6c 6f 6e 67 73 69 |tes (&pb|, longsi|
|000009e0| 7a 65 6f 66 20 28 70 62 | 29 29 3b 0d 09 0d 09 70 |zeof (pb|));....p|
|000009f0| 62 2e 69 6f 50 61 72 61 | 6d 2e 69 6f 4e 61 6d 65 |b.ioPara|m.ioName|
|00000a00| 50 74 72 20 3d 20 62 73 | 70 61 74 68 3b 0d 09 0d |Ptr = bs|path;...|
|00000a10| 09 70 62 2e 69 6f 50 61 | 72 61 6d 2e 69 6f 56 52 |.pb.ioPa|ram.ioVR|
|00000a20| 65 66 4e 75 6d 20 3d 20 | 76 6e 75 6d 3b 20 0d 09 |efNum = |vnum; ..|
|00000a30| 0d 09 72 65 74 75 72 6e | 20 28 50 42 48 44 65 6c |..return| (PBHDel|
|00000a40| 65 74 65 20 28 26 70 62 | 2c 20 66 61 6c 73 65 29 |ete (&pb|, false)|
|00000a50| 20 3d 3d 20 6e 6f 45 72 | 72 29 3b 0d 09 7d 20 2f | == noEr|r);..} /|
|00000a60| 2a 66 69 6c 65 64 65 6c | 65 74 65 2a 2f 0d 09 0d |*filedel|ete*/...|
|00000a70| 0d 76 6f 69 64 20 66 69 | 6c 65 63 6c 6f 73 65 20 |.void fi|leclose |
|00000a80| 28 73 68 6f 72 74 20 66 | 6e 75 6d 29 20 7b 0d 09 |(short f|num) {..|
|00000a90| 0d 09 69 66 20 28 66 6e | 75 6d 20 21 3d 20 30 29 |..if (fn|um != 0)|
|00000aa0| 0d 09 09 46 53 43 6c 6f | 73 65 20 28 66 6e 75 6d |...FSClo|se (fnum|
|00000ab0| 29 3b 0d 09 7d 20 2f 2a | 66 69 6c 65 63 6c 6f 73 |);..} /*|fileclos|
|00000ac0| 65 2a 2f 0d 09 0d 0d 62 | 6f 6f 6c 65 61 6e 20 66 |e*/....b|oolean f|
|00000ad0| 69 6c 65 73 65 74 65 6f | 66 20 28 73 68 6f 72 74 |ileseteo|f (short|
|00000ae0| 20 66 6e 75 6d 2c 20 6c | 6f 6e 67 20 65 6f 66 29 | fnum, l|ong eof)|
|00000af0| 20 7b 0d 09 0d 09 4f 53 | 45 72 72 20 65 72 72 63 | {....OS|Err errc|
|00000b00| 6f 64 65 3b 0d 09 0d 09 | 69 66 20 28 66 6e 75 6d |ode;....|if (fnum|
|00000b10| 20 21 3d 20 30 29 20 7b | 0d 09 0d 09 09 65 72 72 | != 0) {|.....err|
|00000b20| 63 6f 64 65 20 3d 20 53 | 65 74 45 4f 46 20 28 66 |code = S|etEOF (f|
|00000b30| 6e 75 6d 2c 20 65 6f 66 | 29 3b 0d 09 09 0d 09 09 |num, eof|);......|
|00000b40| 72 65 74 75 72 6e 20 28 | 65 72 72 63 6f 64 65 20 |return (|errcode |
|00000b50| 3d 3d 20 6e 6f 45 72 72 | 29 3b 0d 09 09 7d 0d 09 |== noErr|);...}..|
|00000b60| 09 0d 09 72 65 74 75 72 | 6e 20 28 74 72 75 65 29 |...retur|n (true)|
|00000b70| 3b 0d 09 7d 20 2f 2a 66 | 69 6c 65 73 65 74 65 6f |;..} /*f|ileseteo|
|00000b80| 66 2a 2f 0d 09 0d 0d 62 | 6f 6f 6c 65 61 6e 20 66 |f*/....b|oolean f|
|00000b90| 69 6c 65 6f 70 65 6e 6f | 72 63 72 65 61 74 65 20 |ileopeno|rcreate |
|00000ba0| 28 62 69 67 73 74 72 69 | 6e 67 20 62 73 2c 20 73 |(bigstri|ng bs, s|
|00000bb0| 68 6f 72 74 20 76 6e 75 | 6d 2c 20 4f 53 54 79 70 |hort vnu|m, OSTyp|
|00000bc0| 65 20 63 72 65 61 74 6f | 72 2c 20 4f 53 54 79 70 |e creato|r, OSTyp|
|00000bd0| 65 20 66 69 6c 65 74 79 | 70 65 2c 20 73 68 6f 72 |e filety|pe, shor|
|00000be0| 74 20 2a 66 6e 75 6d 29 | 20 7b 0d 09 0d 09 2f 2a |t *fnum)| {..../*|
|00000bf0| 0d 09 6f 70 65 6e 20 6f | 72 20 63 72 65 61 74 65 |..open o|r create|
|00000c00| 20 61 20 66 69 6c 65 20 | 69 6e 64 69 63 61 74 65 | a file |indicate|
|00000c10| 64 20 62 79 20 62 73 20 | 61 6e 64 20 76 6e 75 6d |d by bs |and vnum|
|00000c20| 2e 20 20 69 66 20 62 73 | 20 69 73 20 61 20 66 75 |. if bs| is a fu|
|00000c30| 6c 6c 20 70 61 74 68 2c | 20 0d 09 73 65 74 20 76 |ll path,| ..set v|
|00000c40| 6e 75 6d 20 74 6f 20 30 | 2e 20 20 72 65 74 75 72 |num to 0|. retur|
|00000c50| 6e 20 77 69 74 68 20 66 | 6e 75 6d 20 73 65 74 20 |n with f|num set |
|00000c60| 74 6f 20 74 68 65 20 4d | 61 63 20 66 69 6c 65 73 |to the M|ac files|
|00000c70| 79 73 74 65 6d 27 73 20 | 66 69 6c 65 20 6e 75 6d |ystem's |file num|
|00000c80| 62 65 72 0d 09 66 6f 72 | 20 74 68 65 20 66 69 6c |ber..for| the fil|
|00000c90| 65 2e 0d 09 0d 09 69 66 | 20 77 65 20 6f 70 65 6e |e.....if| we open|
|00000ca0| 20 61 20 66 69 6c 65 2c | 20 77 65 20 74 61 6b 65 | a file,| we take|
|00000cb0| 73 20 77 68 61 74 20 77 | 65 20 67 65 74 20 69 6e |s what w|e get in|
|00000cc0| 20 74 68 65 20 63 72 65 | 61 74 6f 72 20 61 6e 64 | the cre|ator and|
|00000cd0| 20 66 69 6c 65 74 79 70 | 65 20 64 65 70 61 72 74 | filetyp|e depart|
|00000ce0| 6d 65 6e 74 2e 0d 09 68 | 6f 77 65 76 65 72 2c 20 |ment...h|owever, |
|00000cf0| 69 66 20 77 65 20 63 72 | 65 61 74 65 20 61 20 66 |if we cr|eate a f|
|00000d00| 69 6c 65 20 69 74 27 73 | 20 6f 66 20 74 68 65 20 |ile it's| of the |
|00000d10| 69 6e 64 69 63 61 74 65 | 64 20 66 69 6c 65 74 79 |indicate|d filety|
|00000d20| 70 65 20 61 6e 64 20 63 | 72 65 61 74 6f 72 2e 0d |pe and c|reator..|
|00000d30| 09 2a 2f 0d 09 0d 09 69 | 66 20 28 46 53 4f 70 65 |.*/....i|f (FSOpe|
|00000d40| 6e 20 28 62 73 2c 20 76 | 6e 75 6d 2c 20 66 6e 75 |n (bs, v|num, fnu|
|00000d50| 6d 29 20 3d 3d 20 6e 6f | 45 72 72 29 20 2f 2a 66 |m) == no|Err) /*f|
|00000d60| 69 6c 65 20 65 78 69 73 | 74 73 20 61 6e 64 20 69 |ile exis|ts and i|
|00000d70| 73 20 6f 70 65 6e 2a 2f | 0d 09 09 72 65 74 75 72 |s open*/|...retur|
|00000d80| 6e 20 28 74 72 75 65 29 | 3b 0d 09 0d 09 69 66 20 |n (true)|;....if |
|00000d90| 28 43 72 65 61 74 65 20 | 28 62 73 2c 20 76 6e 75 |(Create |(bs, vnu|
|00000da0| 6d 2c 20 63 72 65 61 74 | 6f 72 2c 20 66 69 6c 65 |m, creat|or, file|
|00000db0| 74 79 70 65 29 20 21 3d | 20 6e 6f 45 72 72 29 0d |type) !=| noErr).|
|00000dc0| 09 09 72 65 74 75 72 6e | 20 28 66 61 6c 73 65 29 |..return| (false)|
|00000dd0| 3b 0d 09 0d 09 69 66 20 | 28 46 53 4f 70 65 6e 20 |;....if |(FSOpen |
|00000de0| 28 62 73 2c 20 76 6e 75 | 6d 2c 20 66 6e 75 6d 29 |(bs, vnu|m, fnum)|
|00000df0| 20 21 3d 20 6e 6f 45 72 | 72 29 20 7b 0d 09 0d 09 | != noEr|r) {....|
|00000e00| 09 46 53 43 6c 6f 73 65 | 20 28 2a 66 6e 75 6d 29 |.FSClose| (*fnum)|
|00000e10| 3b 0d 09 09 09 0d 09 09 | 66 69 6c 65 64 65 6c 65 |;.......|filedele|
|00000e20| 74 65 20 28 62 73 2c 20 | 76 6e 75 6d 29 3b 0d 09 |te (bs, |vnum);..|
|00000e30| 09 0d 09 09 72 65 74 75 | 72 6e 20 28 66 61 6c 73 |....retu|rn (fals|
|00000e40| 65 29 3b 20 2f 2a 66 61 | 69 6c 65 64 20 74 6f 20 |e); /*fa|iled to |
|00000e50| 6f 70 65 6e 20 74 68 65 | 20 66 69 6c 65 20 66 6f |open the| file fo|
|00000e60| 72 20 77 72 69 74 69 6e | 67 2a 2f 0d 09 09 7d 0d |r writin|g*/...}.|
|00000e70| 09 0d 09 72 65 74 75 72 | 6e 20 28 74 72 75 65 29 |...retur|n (true)|
|00000e80| 3b 0d 09 7d 20 2f 2a 66 | 69 6c 65 6f 70 65 6e 6f |;..} /*f|ileopeno|
|00000e90| 72 63 72 65 61 74 65 2a | 2f 0d 09 0d 09 0d 62 6f |rcreate*|/.....bo|
|00000ea0| 6f 6c 65 61 6e 20 66 69 | 6c 65 6f 70 65 6e 20 28 |olean fi|leopen (|
|00000eb0| 62 69 67 73 74 72 69 6e | 67 20 62 73 2c 20 73 68 |bigstrin|g bs, sh|
|00000ec0| 6f 72 74 20 76 6e 75 6d | 2c 20 73 68 6f 72 74 20 |ort vnum|, short |
|00000ed0| 2a 66 6e 75 6d 29 20 7b | 0d 09 0d 09 72 65 67 69 |*fnum) {|....regi|
|00000ee0| 73 74 65 72 20 4f 53 45 | 72 72 20 65 63 3b 0d 09 |ster OSE|rr ec;..|
|00000ef0| 0d 09 65 63 20 3d 20 46 | 53 4f 70 65 6e 20 28 62 |..ec = F|SOpen (b|
|00000f00| 73 2c 20 76 6e 75 6d 2c | 20 66 6e 75 6d 29 3b 0d |s, vnum,| fnum);.|
|00000f10| 09 0d 09 72 65 74 75 72 | 6e 20 28 65 63 20 3d 3d |...retur|n (ec ==|
|00000f20| 20 6e 6f 45 72 72 29 3b | 0d 09 7d 20 2f 2a 66 69 | noErr);|..} /*fi|
|00000f30| 6c 65 6f 70 65 6e 2a 2f | 0d 09 0d 09 0d 62 6f 6f |leopen*/|.....boo|
|00000f40| 6c 65 61 6e 20 66 69 6c | 65 6e 65 77 20 28 62 69 |lean fil|enew (bi|
|00000f50| 67 73 74 72 69 6e 67 20 | 62 73 66 6e 61 6d 65 2c |gstring |bsfname,|
|00000f60| 20 73 68 6f 72 74 20 76 | 6e 75 6d 2c 20 4f 53 54 | short v|num, OST|
|00000f70| 79 70 65 20 63 72 65 61 | 74 6f 72 2c 20 4f 53 54 |ype crea|tor, OST|
|00000f80| 79 70 65 20 66 69 6c 65 | 74 79 70 65 2c 20 73 68 |ype file|type, sh|
|00000f90| 6f 72 74 20 2a 66 6e 75 | 6d 29 20 7b 0d 09 0d 09 |ort *fnu|m) {....|
|00000fa0| 72 65 67 69 73 74 65 72 | 20 4f 53 45 72 72 20 65 |register| OSErr e|
|00000fb0| 72 72 63 6f 64 65 3b 0d | 09 0d 09 69 66 20 28 46 |rrcode;.|...if (F|
|00000fc0| 53 4f 70 65 6e 20 28 62 | 73 66 6e 61 6d 65 2c 20 |SOpen (b|sfname, |
|00000fd0| 76 6e 75 6d 2c 20 66 6e | 75 6d 29 20 3d 3d 20 6e |vnum, fn|um) == n|
|00000fe0| 6f 45 72 72 29 20 7b 20 | 2f 2a 66 69 6c 65 20 65 |oErr) { |/*file e|
|00000ff0| 78 69 73 74 73 2c 20 64 | 65 6c 65 74 65 20 69 74 |xists, d|elete it|
|00001000| 2a 2f 0d 09 0d 09 09 46 | 53 43 6c 6f 73 65 20 28 |*/.....F|SClose (|
|00001010| 2a 66 6e 75 6d 29 3b 0d | 09 0d 09 09 66 69 6c 65 |*fnum);.|....file|
|00001020| 64 65 6c 65 74 65 20 28 | 62 73 66 6e 61 6d 65 2c |delete (|bsfname,|
|00001030| 20 76 6e 75 6d 29 3b 0d | 09 09 7d 0d 09 09 0d 09 | vnum);.|..}.....|
|00001040| 65 72 72 63 6f 64 65 20 | 3d 20 43 72 65 61 74 65 |errcode |= Create|
|00001050| 20 28 62 73 66 6e 61 6d | 65 2c 20 76 6e 75 6d 2c | (bsfnam|e, vnum,|
|00001060| 20 63 72 65 61 74 6f 72 | 2c 20 66 69 6c 65 74 79 | creator|, filety|
|00001070| 70 65 29 3b 0d 09 09 0d | 09 69 66 20 28 6f 73 65 |pe);....|.if (ose|
|00001080| 72 72 6f 72 20 28 65 72 | 72 63 6f 64 65 29 29 20 |rror (er|rcode)) |
|00001090| 2f 2a 66 61 69 6c 65 64 | 20 74 6f 20 6f 70 65 6e |/*failed| to open|
|000010a0| 20 74 68 65 20 66 69 6c | 65 20 66 6f 72 20 77 72 | the fil|e for wr|
|000010b0| 69 74 69 6e 67 2a 2f 0d | 09 09 72 65 74 75 72 6e |iting*/.|..return|
|000010c0| 20 28 66 61 6c 73 65 29 | 3b 0d 09 0d 09 65 72 72 | (false)|;....err|
|000010d0| 63 6f 64 65 20 3d 20 46 | 53 4f 70 65 6e 20 28 62 |code = F|SOpen (b|
|000010e0| 73 66 6e 61 6d 65 2c 20 | 76 6e 75 6d 2c 20 66 6e |sfname, |vnum, fn|
|000010f0| 75 6d 29 3b 0d 09 0d 09 | 69 66 20 28 6f 73 65 72 |um);....|if (oser|
|00001100| 72 6f 72 20 28 65 72 72 | 63 6f 64 65 29 29 20 7b |ror (err|code)) {|
|00001110| 0d 09 0d 09 09 46 53 43 | 6c 6f 73 65 20 28 2a 66 |.....FSC|lose (*f|
|00001120| 6e 75 6d 29 3b 0d 09 09 | 09 0d 09 09 66 69 6c 65 |num);...|....file|
|00001130| 64 65 6c 65 74 65 20 28 | 62 73 66 6e 61 6d 65 2c |delete (|bsfname,|
|00001140| 20 76 6e 75 6d 29 3b 0d | 09 09 0d 09 09 72 65 74 | vnum);.|.....ret|
|00001150| 75 72 6e 20 28 66 61 6c | 73 65 29 3b 20 2f 2a 66 |urn (fal|se); /*f|
|00001160| 61 69 6c 65 64 20 74 6f | 20 6f 70 65 6e 20 74 68 |ailed to| open th|
|00001170| 65 20 66 69 6c 65 20 66 | 6f 72 20 77 72 69 74 69 |e file f|or writi|
|00001180| 6e 67 2a 2f 0d 09 09 7d | 0d 09 09 0d 09 72 65 74 |ng*/...}|.....ret|
|00001190| 75 72 6e 20 28 74 72 75 | 65 29 3b 20 2f 2a 66 69 |urn (tru|e); /*fi|
|000011a0| 6c 65 20 65 78 69 73 74 | 73 20 61 6e 64 20 69 74 |le exist|s and it|
|000011b0| 73 20 6f 70 65 6e 2a 2f | 0d 09 7d 20 2f 2a 66 69 |s open*/|..} /*fi|
|000011c0| 6c 65 6e 65 77 2a 2f 0d | 09 0d 09 0d 62 6f 6f 6c |lenew*/.|....bool|
|000011d0| 65 61 6e 20 66 69 6c 65 | 74 72 75 6e 63 61 74 65 |ean file|truncate|
|000011e0| 20 28 73 68 6f 72 74 20 | 66 6e 75 6d 29 20 7b 0d | (short |fnum) {.|
|000011f0| 09 0d 09 72 65 74 75 72 | 6e 20 28 53 65 74 45 4f |...retur|n (SetEO|
|00001200| 46 20 28 66 6e 75 6d 2c | 20 30 29 20 3d 3d 20 6e |F (fnum,| 0) == n|
|00001210| 6f 45 72 72 29 3b 0d 09 | 7d 20 2f 2a 66 69 6c 65 |oErr);..|} /*file|
|00001220| 74 72 75 6e 63 61 74 65 | 2a 2f 0d 0d 0d 6c 6f 6e |truncate|*/...lon|
|00001230| 67 20 66 69 6c 65 67 65 | 74 73 69 7a 65 20 28 73 |g filege|tsize (s|
|00001240| 68 6f 72 74 20 66 6e 75 | 6d 29 20 7b 0d 09 0d 09 |hort fnu|m) {....|
|00001250| 2f 2a 0d 09 67 65 74 20 | 74 68 65 20 73 69 7a 65 |/*..get |the size|
|00001260| 20 6f 66 20 61 20 66 69 | 6c 65 20 74 68 61 74 27 | of a fi|le that'|
|00001270| 73 20 61 6c 72 65 61 64 | 79 20 6f 70 65 6e 2e 0d |s alread|y open..|
|00001280| 09 2a 2f 0d 09 0d 09 6c | 6f 6e 67 20 66 69 6c 65 |.*/....l|ong file|
|00001290| 73 69 7a 65 3b 0d 09 0d | 09 69 66 20 28 47 65 74 |size;...|.if (Get|
|000012a0| 45 4f 46 20 28 66 6e 75 | 6d 2c 20 26 66 69 6c 65 |EOF (fnu|m, &file|
|000012b0| 73 69 7a 65 29 20 21 3d | 20 6e 6f 45 72 72 29 0d |size) !=| noErr).|
|000012c0| 09 09 66 69 6c 65 73 69 | 7a 65 20 3d 20 30 3b 0d |..filesi|ze = 0;.|
|000012d0| 09 0d 09 72 65 74 75 72 | 6e 20 28 66 69 6c 65 73 |...retur|n (files|
|000012e0| 69 7a 65 29 3b 0d 09 7d | 20 2f 2a 66 69 6c 65 67 |ize);..}| /*fileg|
|000012f0| 65 74 73 69 7a 65 2a 2f | 0d 0d 0d 62 6f 6f 6c 65 |etsize*/|...boole|
|00001300| 61 6e 20 66 69 6c 65 77 | 72 69 74 65 20 28 73 68 |an filew|rite (sh|
|00001310| 6f 72 74 20 66 6e 75 6d | 2c 20 6c 6f 6e 67 20 63 |ort fnum|, long c|
|00001320| 74 77 72 69 74 65 2c 20 | 76 6f 69 64 20 2a 62 75 |twrite, |void *bu|
|00001330| 66 66 65 72 29 20 7b 0d | 09 0d 09 2f 2a 0d 09 77 |ffer) {.|.../*..w|
|00001340| 72 69 74 65 20 63 74 77 | 72 69 74 65 20 62 79 74 |rite ctw|rite byt|
|00001350| 65 73 20 66 72 6f 6d 20 | 62 75 66 66 65 72 20 74 |es from |buffer t|
|00001360| 6f 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 70 6f |o the cu|rrent po|
|00001370| 73 69 74 69 6f 6e 20 69 | 6e 20 66 69 6c 65 20 6e |sition i|n file n|
|00001380| 75 6d 62 65 72 0d 09 66 | 6e 75 6d 2e 20 20 72 65 |umber..f|num. re|
|00001390| 74 75 72 6e 20 74 72 75 | 65 20 69 66 66 20 73 75 |turn tru|e iff su|
|000013a0| 63 63 65 73 73 66 75 6c | 2e 0d 09 2a 2f 0d 0d 09 |ccessful|...*/...|
|000013b0| 69 66 20 28 63 74 77 72 | 69 74 65 20 3e 20 30 29 |if (ctwr|ite > 0)|
|000013c0| 20 0d 0d 09 09 69 66 20 | 28 46 53 57 72 69 74 65 | ....if |(FSWrite|
|000013d0| 20 28 66 6e 75 6d 2c 20 | 26 63 74 77 72 69 74 65 | (fnum, |&ctwrite|
|000013e0| 2c 20 62 75 66 66 65 72 | 29 20 21 3d 20 6e 6f 45 |, buffer|) != noE|
|000013f0| 72 72 29 0d 09 09 0d 09 | 09 09 72 65 74 75 72 6e |rr).....|..return|
|00001400| 20 28 66 61 6c 73 65 29 | 3b 0d 09 0d 09 72 65 74 | (false)|;....ret|
|00001410| 75 72 6e 20 28 74 72 75 | 65 29 3b 0d 09 7d 20 2f |urn (tru|e);..} /|
|00001420| 2a 66 69 6c 65 77 72 69 | 74 65 2a 2f 0d 09 0d 09 |*filewri|te*/....|
|00001430| 0d 62 6f 6f 6c 65 61 6e | 20 66 69 6c 65 72 65 61 |.boolean| filerea|
|00001440| 64 20 28 73 68 6f 72 74 | 20 66 6e 75 6d 2c 20 6c |d (short| fnum, l|
|00001450| 6f 6e 67 20 63 74 72 65 | 61 64 2c 20 76 6f 69 64 |ong ctre|ad, void|
|00001460| 20 2a 62 75 66 66 65 72 | 29 20 7b 0d 09 0d 09 2f | *buffer|) {..../|
|00001470| 2a 0d 09 72 65 61 64 20 | 63 74 72 65 61 64 20 62 |*..read |ctread b|
|00001480| 79 74 65 73 20 66 72 6f | 6d 20 74 68 65 20 63 75 |ytes fro|m the cu|
|00001490| 72 72 65 6e 74 20 70 6f | 73 69 74 69 6f 6e 20 69 |rrent po|sition i|
|000014a0| 6e 20 66 69 6c 65 20 6e | 75 6d 62 65 72 20 66 6e |n file n|umber fn|
|000014b0| 75 6d 20 69 6e 74 6f 0d | 09 74 68 65 20 62 75 66 |um into.|.the buf|
|000014c0| 66 65 72 2e 20 20 72 65 | 74 75 72 6e 20 74 72 75 |fer. re|turn tru|
|000014d0| 65 20 69 66 66 20 73 75 | 63 63 65 73 73 66 75 6c |e iff su|ccessful|
|000014e0| 2e 0d 09 2a 2f 0d 0d 09 | 69 66 20 28 63 74 72 65 |...*/...|if (ctre|
|000014f0| 61 64 20 3e 20 30 29 0d | 09 09 0d 09 09 69 66 20 |ad > 0).|.....if |
|00001500| 28 6f 73 65 72 72 6f 72 | 20 28 46 53 52 65 61 64 |(oserror| (FSRead|
|00001510| 20 28 66 6e 75 6d 2c 20 | 26 63 74 72 65 61 64 2c | (fnum, |&ctread,|
|00001520| 20 62 75 66 66 65 72 29 | 29 29 0d 09 09 0d 09 09 | buffer)|))......|
|00001530| 09 72 65 74 75 72 6e 20 | 28 66 61 6c 73 65 29 3b |.return |(false);|
|00001540| 0d 09 09 09 0d 09 72 65 | 74 75 72 6e 20 28 74 72 |......re|turn (tr|
|00001550| 75 65 29 3b 0d 09 7d 20 | 2f 2a 66 69 6c 65 72 65 |ue);..} |/*filere|
|00001560| 61 64 2a 2f 0d 09 0d 09 | 0d 62 6f 6f 6c 65 61 6e |ad*/....|.boolean|
|00001570| 20 66 69 6c 65 67 65 74 | 63 68 61 72 20 28 73 68 | fileget|char (sh|
|00001580| 6f 72 74 20 66 6e 75 6d | 2c 20 62 79 74 65 20 2a |ort fnum|, byte *|
|00001590| 62 75 66 66 65 72 29 20 | 7b 0d 09 0d 09 2f 2a 0d |buffer) |{..../*.|
|000015a0| 09 72 65 61 64 20 74 68 | 65 20 6e 65 78 74 20 63 |.read th|e next c|
|000015b0| 68 61 72 61 63 74 65 72 | 20 66 72 6f 6d 20 74 68 |haracter| from th|
|000015c0| 65 20 69 6e 64 69 63 61 | 74 65 64 20 66 69 6c 65 |e indica|ted file|
|000015d0| 2c 20 72 65 74 75 72 6e | 69 6e 67 20 69 74 20 69 |, return|ing it i|
|000015e0| 6e 20 2a 62 75 66 66 65 | 72 2e 0d 09 0d 09 72 65 |n *buffe|r.....re|
|000015f0| 74 75 72 6e 20 66 61 6c | 73 65 20 69 66 20 77 65 |turn fal|se if we|
|00001600| 27 72 65 20 61 74 20 74 | 68 65 20 65 6e 64 20 6f |'re at t|he end o|
|00001610| 66 20 74 68 65 20 66 69 | 6c 65 2c 20 77 69 74 68 |f the fi|le, with|
|00001620| 6f 75 74 20 74 72 69 67 | 67 65 72 69 6e 67 20 61 |out trig|gering a|
|00001630| 6e 20 65 72 72 6f 72 0d | 09 64 69 61 6c 6f 67 2e |n error.|.dialog.|
|00001640| 0d 09 2a 2f 0d 09 0d 09 | 6c 6f 6e 67 20 66 70 6f |..*/....|long fpo|
|00001650| 73 2c 20 65 6f 66 3b 0d | 09 0d 09 69 66 20 28 47 |s, eof;.|...if (G|
|00001660| 65 74 46 50 6f 73 20 28 | 66 6e 75 6d 2c 20 26 66 |etFPos (|fnum, &f|
|00001670| 70 6f 73 29 20 21 3d 20 | 6e 6f 45 72 72 29 0d 09 |pos) != |noErr)..|
|00001680| 09 72 65 74 75 72 6e 20 | 28 66 61 6c 73 65 29 3b |.return |(false);|
|00001690| 0d 09 0d 09 69 66 20 28 | 47 65 74 45 4f 46 20 28 |....if (|GetEOF (|
|000016a0| 66 6e 75 6d 2c 20 26 65 | 6f 66 29 20 21 3d 20 6e |fnum, &e|of) != n|
|000016b0| 6f 45 72 72 29 0d 09 09 | 72 65 74 75 72 6e 20 28 |oErr)...|return (|
|000016c0| 66 61 6c 73 65 29 3b 0d | 09 0d 09 69 66 20 28 66 |false);.|...if (f|
|000016d0| 70 6f 73 20 3d 3d 20 65 | 6f 66 29 0d 09 09 72 65 |pos == e|of)...re|
|000016e0| 74 75 72 6e 20 28 66 61 | 6c 73 65 29 3b 0d 09 0d |turn (fa|lse);...|
|000016f0| 09 69 66 20 28 21 66 69 | 6c 65 72 65 61 64 20 28 |.if (!fi|leread (|
|00001700| 66 6e 75 6d 2c 20 31 4c | 2c 20 62 75 66 66 65 72 |fnum, 1L|, buffer|
|00001710| 29 29 0d 09 09 72 65 74 | 75 72 6e 20 28 66 61 6c |))...ret|urn (fal|
|00001720| 73 65 29 3b 0d 09 09 0d | 09 72 65 74 75 72 6e 20 |se);....|.return |
|00001730| 28 74 72 75 65 29 3b 0d | 09 7d 20 2f 2a 66 69 6c |(true);.|.} /*fil|
|00001740| 65 67 65 74 63 68 61 72 | 2a 2f 0d 09 0d 09 0d 62 |egetchar|*/.....b|
|00001750| 6f 6f 6c 65 61 6e 20 66 | 69 6c 65 77 72 69 74 65 |oolean f|ilewrite|
|00001760| 68 61 6e 64 6c 65 20 28 | 73 68 6f 72 74 20 66 6e |handle (|short fn|
|00001770| 75 6d 2c 20 48 61 6e 64 | 6c 65 20 68 29 20 7b 0d |um, Hand|le h) {.|
|00001780| 09 0d 09 2f 2a 0d 09 77 | 72 69 74 65 20 74 68 65 |.../*..w|rite the|
|00001790| 20 69 6e 64 69 63 61 74 | 65 64 20 68 61 6e 64 6c | indicat|ed handl|
|000017a0| 65 20 74 6f 20 74 68 65 | 20 6f 70 65 6e 20 66 69 |e to the| open fi|
|000017b0| 6c 65 20 69 6e 64 69 63 | 61 74 65 64 20 62 79 20 |le indic|ated by |
|000017c0| 66 6e 75 6d 20 61 74 20 | 74 68 65 0d 09 63 75 72 |fnum at |the..cur|
|000017d0| 72 65 6e 74 20 70 6f 73 | 69 74 69 6f 6e 20 69 6e |rent pos|ition in|
|000017e0| 20 74 68 65 20 66 69 6c | 65 2e 0d 09 2a 2f 0d 09 | the fil|e...*/..|
|000017f0| 0d 09 72 65 74 75 72 6e | 20 28 66 69 6c 65 77 72 |..return| (filewr|
|00001800| 69 74 65 20 28 66 6e 75 | 6d 2c 20 47 65 74 48 61 |ite (fnu|m, GetHa|
|00001810| 6e 64 6c 65 53 69 7a 65 | 20 28 68 29 2c 20 2a 68 |ndleSize| (h), *h|
|00001820| 29 29 3b 0d 09 7d 20 2f | 2a 66 69 6c 65 77 72 69 |));..} /|*filewri|
|00001830| 74 65 68 61 6e 64 6c 65 | 2a 2f 0d 09 0d 09 0d 62 |tehandle|*/.....b|
|00001840| 6f 6f 6c 65 61 6e 20 66 | 69 6c 65 72 65 61 64 68 |oolean f|ilereadh|
|00001850| 61 6e 64 6c 65 20 28 73 | 68 6f 72 74 20 66 6e 75 |andle (s|hort fnu|
|00001860| 6d 2c 20 6c 6f 6e 67 20 | 63 74 62 79 74 65 73 2c |m, long |ctbytes,|
|00001870| 20 48 61 6e 64 6c 65 20 | 2a 68 72 65 74 75 72 6e | Handle |*hreturn|
|00001880| 65 64 29 20 7b 0d 09 0d | 09 48 61 6e 64 6c 65 20 |ed) {...|.Handle |
|00001890| 68 3b 0d 09 62 6f 6f 6c | 65 61 6e 20 66 6c 3b 0d |h;..bool|ean fl;.|
|000018a0| 09 0d 09 69 66 20 28 21 | 6e 65 77 63 6c 65 61 72 |...if (!|newclear|
|000018b0| 68 61 6e 64 6c 65 20 28 | 63 74 62 79 74 65 73 2c |handle (|ctbytes,|
|000018c0| 20 68 72 65 74 75 72 6e | 65 64 29 29 0d 09 09 72 | hreturn|ed))...r|
|000018d0| 65 74 75 72 6e 20 28 66 | 61 6c 73 65 29 3b 0d 09 |eturn (f|alse);..|
|000018e0| 09 0d 09 68 20 3d 20 2a | 68 72 65 74 75 72 6e 65 |...h = *|hreturne|
|000018f0| 64 3b 20 2f 2a 63 6f 70 | 79 20 69 6e 74 6f 20 72 |d; /*cop|y into r|
|00001900| 65 67 69 73 74 65 72 2a | 2f 0d 09 0d 09 6c 6f 63 |egister*|/....loc|
|00001910| 6b 68 61 6e 64 6c 65 20 | 28 68 29 3b 0d 09 0d 09 |khandle |(h);....|
|00001920| 66 6c 20 3d 20 66 69 6c | 65 72 65 61 64 20 28 66 |fl = fil|eread (f|
|00001930| 6e 75 6d 2c 20 63 74 62 | 79 74 65 73 2c 20 2a 68 |num, ctb|ytes, *h|
|00001940| 29 3b 0d 09 0d 09 75 6e | 6c 6f 63 6b 68 61 6e 64 |);....un|lockhand|
|00001950| 6c 65 20 28 68 29 3b 0d | 09 09 0d 09 69 66 20 28 |le (h);.|....if (|
|00001960| 21 66 6c 29 20 7b 0d 09 | 09 0d 09 09 64 69 73 70 |!fl) {..|....disp|
|00001970| 6f 73 65 68 61 6e 64 6c | 65 20 28 68 29 3b 0d 09 |osehandl|e (h);..|
|00001980| 09 0d 09 09 2a 68 72 65 | 74 75 72 6e 65 64 20 3d |....*hre|turned =|
|00001990| 20 6e 69 6c 3b 0d 09 09 | 0d 09 09 72 65 74 75 72 | nil;...|...retur|
|000019a0| 6e 20 28 66 61 6c 73 65 | 29 3b 0d 09 09 7d 0d 09 |n (false|);...}..|
|000019b0| 09 0d 09 72 65 74 75 72 | 6e 20 28 74 72 75 65 29 |...retur|n (true)|
|000019c0| 3b 0d 09 7d 20 2f 2a 66 | 69 6c 65 72 65 61 64 68 |;..} /*f|ilereadh|
|000019d0| 61 6e 64 6c 65 2a 2f 09 | 0d 0d 0d 62 6f 6f 6c 65 |andle*/.|...boole|
|000019e0| 61 6e 20 66 69 6c 65 72 | 65 61 64 77 68 6f 6c 65 |an filer|eadwhole|
|000019f0| 66 69 6c 65 20 28 73 68 | 6f 72 74 20 66 6e 75 6d |file (sh|ort fnum|
|00001a00| 2c 20 48 61 6e 64 6c 65 | 20 2a 68 72 65 74 75 72 |, Handle| *hretur|
|00001a10| 6e 65 64 29 20 7b 0d 09 | 0d 09 2f 2a 0d 09 6c 6f |ned) {..|../*..lo|
|00001a20| 61 64 20 74 68 65 20 77 | 68 6f 6c 65 20 66 69 6c |ad the w|hole fil|
|00001a30| 65 20 69 6e 74 6f 20 6d | 65 6d 6f 72 79 2c 20 72 |e into m|emory, r|
|00001a40| 65 74 75 72 6e 20 74 72 | 75 65 20 69 66 20 69 74 |eturn tr|ue if it|
|00001a50| 20 77 6f 72 6b 65 64 2c | 20 77 69 74 68 0d 09 74 | worked,| with..t|
|00001a60| 68 65 20 68 61 6e 64 6c | 65 20 68 6f 6c 64 69 6e |he handl|e holdin|
|00001a70| 67 20 61 6c 6c 20 74 68 | 65 20 64 61 74 61 20 66 |g all th|e data f|
|00001a80| 72 6f 6d 20 74 68 65 20 | 66 69 6c 65 2e 0d 09 2a |rom the |file...*|
|00001a90| 2f 0d 09 0d 09 72 65 74 | 75 72 6e 20 28 66 69 6c |/....ret|urn (fil|
|00001aa0| 65 72 65 61 64 68 61 6e | 64 6c 65 20 28 66 6e 75 |ereadhan|dle (fnu|
|00001ab0| 6d 2c 20 66 69 6c 65 67 | 65 74 73 69 7a 65 20 28 |m, fileg|etsize (|
|00001ac0| 66 6e 75 6d 29 2c 20 68 | 72 65 74 75 72 6e 65 64 |fnum), h|returned|
|00001ad0| 29 29 3b 0d 09 7d 20 2f | 2a 66 69 6c 65 72 65 61 |));..} /|*filerea|
|00001ae0| 64 77 68 6f 6c 65 66 69 | 6c 65 2a 2f 0d 0d 09 0d |dwholefi|le*/....|
|00001af0| 62 6f 6f 6c 65 61 6e 20 | 66 69 6c 65 70 61 72 73 |boolean |filepars|
|00001b00| 65 76 6f 6c 6e 61 6d 65 | 20 28 62 73 70 61 74 68 |evolname| (bspath|
|00001b10| 2c 20 76 6e 75 6d 29 20 | 62 69 67 73 74 72 69 6e |, vnum) |bigstrin|
|00001b20| 67 20 62 73 70 61 74 68 | 3b 20 73 68 6f 72 74 20 |g bspath|; short |
|00001b30| 2a 76 6e 75 6d 3b 20 7b | 0d 09 0d 09 2f 2a 0d 09 |*vnum; {|..../*..|
|00001b40| 63 6f 6e 76 65 72 74 20 | 61 20 66 75 6c 6c 20 70 |convert |a full p|
|00001b50| 61 74 68 2c 20 77 68 69 | 63 68 20 6d 69 67 68 74 |ath, whi|ch might|
|00001b60| 20 63 6f 6e 74 61 69 6e | 20 61 20 76 6f 6c 75 6d | contain| a volum|
|00001b70| 65 20 6e 61 6d 65 20 61 | 74 20 74 68 65 20 62 65 |e name a|t the be|
|00001b80| 67 69 6e 6e 69 6e 67 0d | 09 74 6f 20 61 20 70 61 |ginning.|.to a pa|
|00001b90| 74 68 20 77 69 74 68 20 | 6e 6f 20 76 6f 6c 75 6d |th with |no volum|
|00001ba0| 65 20 6e 61 6d 65 2c 20 | 61 6e 64 20 69 74 27 73 |e name, |and it's|
|00001bb0| 20 61 73 73 6f 63 69 61 | 74 65 64 20 76 6f 6c 75 | associa|ted volu|
|00001bc0| 6d 65 20 6e 75 6d 62 65 | 72 20 69 6e 20 76 6e 75 |me numbe|r in vnu|
|00001bd0| 6d 2e 0d 09 0d 09 65 78 | 61 6d 70 6c 65 3a 20 22 |m.....ex|ample: "|
|00001be0| 52 6f 76 65 72 aa 3a 4d | 4f 52 45 20 57 6f 72 6b |Rover.:M|ORE Work|
|00001bf0| 22 20 77 69 6c 6c 20 72 | 65 74 75 72 6e 20 77 69 |" will r|eturn wi|
|00001c00| 74 68 20 62 73 70 61 74 | 68 20 3d 20 22 4d 4f 52 |th bspat|h = "MOR|
|00001c10| 45 20 57 6f 72 6b 22 20 | 61 6e 64 0d 09 76 6e 75 |E Work" |and..vnu|
|00001c20| 6d 20 3d 20 2d 32 20 28 | 74 68 65 20 4d 61 63 69 |m = -2 (|the Maci|
|00001c30| 6e 74 6f 73 68 20 76 72 | 65 66 6e 75 6d 20 66 6f |ntosh vr|efnum fo|
|00001c40| 72 20 74 68 65 20 73 65 | 63 6f 6e 64 20 6d 6f 75 |r the se|cond mou|
|00001c50| 6e 74 65 64 20 64 72 69 | 76 65 29 2e 20 20 0d 09 |nted dri|ve). ..|
|00001c60| 0d 09 74 68 69 73 20 63 | 6f 6d 62 69 6e 61 74 69 |..this c|ombinati|
|00001c70| 6f 6e 20 6f 66 20 69 6e | 66 6f 72 6d 61 74 69 6f |on of in|formatio|
|00001c80| 6e 20 70 6c 75 67 73 20 | 6e 69 63 65 6c 79 20 69 |n plugs |nicely i|
|00001c90| 6e 74 6f 20 61 20 6c 6f | 74 20 6f 66 20 74 68 65 |nto a lo|t of the|
|00001ca0| 20 66 69 6c 65 20 0d 09 | 6d 61 6e 61 67 65 72 20 | file ..|manager |
|00001cb0| 72 6f 75 74 69 6e 65 73 | 2e 0d 09 2a 2f 0d 09 0d |routines|...*/...|
|00001cc0| 09 73 68 6f 72 74 20 69 | 78 20 3d 20 31 3b 0d 09 |.short i|x = 1;..|
|00001cd0| 62 69 67 73 74 72 69 6e | 67 20 62 73 76 6f 6c 6e |bigstrin|g bsvoln|
|00001ce0| 61 6d 65 3b 0d 09 48 50 | 61 72 61 6d 42 6c 6f 63 |ame;..HP|aramBloc|
|00001cf0| 6b 52 65 63 20 70 62 3b | 0d 09 73 68 6f 72 74 20 |kRec pb;|..short |
|00001d00| 76 72 65 66 6e 75 6d 3b | 0d 09 62 69 67 73 74 72 |vrefnum;|..bigstr|
|00001d10| 69 6e 67 20 62 73 3b 0d | 09 0d 09 63 6f 70 79 73 |ing bs;.|...copys|
|00001d20| 74 72 69 6e 67 20 28 62 | 73 70 61 74 68 2c 20 62 |tring (b|spath, b|
|00001d30| 73 29 3b 20 2f 2a 77 6f | 72 6b 20 6f 6e 20 61 20 |s); /*wo|rk on a |
|00001d40| 63 6f 70 79 2a 2f 0d 09 | 0d 09 69 66 20 28 69 73 |copy*/..|..if (is|
|00001d50| 65 6d 70 74 79 73 74 72 | 69 6e 67 20 28 62 73 29 |emptystr|ing (bs)|
|00001d60| 29 0d 09 09 72 65 74 75 | 72 6e 20 28 66 61 6c 73 |)...retu|rn (fals|
|00001d70| 65 29 3b 0d 09 0d 09 69 | 66 20 28 21 73 63 61 6e |e);....i|f (!scan|
|00001d80| 73 74 72 69 6e 67 20 28 | 27 3a 27 2c 20 62 73 2c |string (|':', bs,|
|00001d90| 20 26 69 78 29 29 20 7b | 20 2f 2a 6e 6f 20 63 6f | &ix)) {| /*no co|
|00001da0| 6c 6f 6e 2c 20 74 68 65 | 20 77 68 6f 6c 65 20 74 |lon, the| whole t|
|00001db0| 68 69 6e 67 20 69 73 20 | 61 20 76 6f 6c 6e 61 6d |hing is |a volnam|
|00001dc0| 65 2a 2f 0d 09 0d 09 09 | 63 6f 70 79 73 74 72 69 |e*/.....|copystri|
|00001dd0| 6e 67 20 28 62 73 2c 20 | 62 73 76 6f 6c 6e 61 6d |ng (bs, |bsvolnam|
|00001de0| 65 29 3b 0d 09 09 0d 09 | 09 70 75 73 68 63 68 61 |e);.....|.pushcha|
|00001df0| 72 20 28 27 3a 27 2c 20 | 62 73 76 6f 6c 6e 61 6d |r (':', |bsvolnam|
|00001e00| 65 29 3b 0d 09 09 0d 09 | 09 73 65 74 65 6d 70 74 |e);.....|.setempt|
|00001e10| 79 73 74 72 69 6e 67 20 | 28 62 73 29 3b 0d 09 09 |ystring |(bs);...|
|00001e20| 7d 0d 09 65 6c 73 65 20 | 7b 0d 09 09 6d 69 64 73 |}..else |{...mids|
|00001e30| 74 72 69 6e 67 20 28 62 | 73 2c 20 31 2c 20 69 78 |tring (b|s, 1, ix|
|00001e40| 2c 20 62 73 76 6f 6c 6e | 61 6d 65 29 3b 20 2f 2a |, bsvoln|ame); /*|
|00001e50| 70 69 63 6b 20 6f 66 66 | 20 74 68 65 20 76 6f 6c |pick off| the vol|
|00001e60| 20 6e 61 6d 65 20 61 6e | 64 20 74 68 65 20 63 6f | name an|d the co|
|00001e70| 6c 6f 6e 2a 2f 0d 09 09 | 0d 09 09 64 65 6c 65 74 |lon*/...|...delet|
|00001e80| 65 73 74 72 69 6e 67 20 | 28 62 73 2c 20 31 2c 20 |estring |(bs, 1, |
|00001e90| 69 78 29 3b 0d 09 09 7d | 0d 09 0d 09 63 6c 65 61 |ix);...}|....clea|
|00001ea0| 72 62 79 74 65 73 20 28 | 26 70 62 2c 20 6c 6f 6e |rbytes (|&pb, lon|
|00001eb0| 67 73 69 7a 65 6f 66 20 | 28 70 62 29 29 3b 0d 09 |gsizeof |(pb));..|
|00001ec0| 0d 09 70 62 2e 76 6f 6c | 75 6d 65 50 61 72 61 6d |..pb.vol|umeParam|
|00001ed0| 2e 69 6f 4e 61 6d 65 50 | 74 72 20 3d 20 62 73 76 |.ioNameP|tr = bsv|
|00001ee0| 6f 6c 6e 61 6d 65 3b 0d | 09 0d 09 70 62 2e 76 6f |olname;.|...pb.vo|
|00001ef0| 6c 75 6d 65 50 61 72 61 | 6d 2e 69 6f 56 6f 6c 49 |lumePara|m.ioVolI|
|00001f00| 6e 64 65 78 20 3d 20 2d | 31 3b 20 2f 2a 66 6f 72 |ndex = -|1; /*for|
|00001f10| 63 65 20 68 69 6d 20 74 | 6f 20 75 73 65 20 74 68 |ce him t|o use th|
|00001f20| 65 20 6e 61 6d 65 20 70 | 6f 69 6e 74 65 72 20 6f |e name p|ointer o|
|00001f30| 6e 6c 79 2a 2f 0d 09 0d | 09 69 66 20 28 50 42 47 |nly*/...|.if (PBG|
|00001f40| 65 74 56 49 6e 66 6f 20 | 28 28 50 61 72 6d 42 6c |etVInfo |((ParmBl|
|00001f50| 6b 50 74 72 29 20 26 70 | 62 2c 20 66 61 6c 73 65 |kPtr) &p|b, false|
|00001f60| 29 20 21 3d 20 6e 6f 45 | 72 72 29 0d 09 09 72 65 |) != noE|rr)...re|
|00001f70| 74 75 72 6e 20 28 66 61 | 6c 73 65 29 3b 0d 09 0d |turn (fa|lse);...|
|00001f80| 09 2a 76 6e 75 6d 20 3d | 20 70 62 2e 76 6f 6c 75 |.*vnum =| pb.volu|
|00001f90| 6d 65 50 61 72 61 6d 2e | 69 6f 56 52 65 66 4e 75 |meParam.|ioVRefNu|
|00001fa0| 6d 3b 0d 09 0d 09 72 65 | 74 75 72 6e 20 28 74 72 |m;....re|turn (tr|
|00001fb0| 75 65 29 3b 0d 09 7d 20 | 2f 2a 66 69 6c 65 70 61 |ue);..} |/*filepa|
|00001fc0| 72 73 65 76 6f 6c 6e 61 | 6d 65 2a 2f 0d 0d 0d 62 |rsevolna|me*/...b|
|00001fd0| 6f 6f 6c 65 61 6e 20 66 | 69 6c 65 66 72 6f 6d 70 |oolean f|ilefromp|
|00001fe0| 61 74 68 20 28 70 61 74 | 68 2c 20 66 6e 61 6d 65 |ath (pat|h, fname|
|00001ff0| 29 20 62 69 67 73 74 72 | 69 6e 67 20 70 61 74 68 |) bigstr|ing path|
|00002000| 2c 20 66 6e 61 6d 65 3b | 20 7b 0d 09 0d 09 2f 2a |, fname;| {..../*|
|00002010| 0d 09 72 65 74 75 72 6e | 20 61 6c 6c 20 74 68 65 |..return| all the|
|00002020| 20 63 68 61 72 61 63 74 | 65 72 73 20 74 6f 20 74 | charact|ers to t|
|00002030| 68 65 20 72 69 67 68 74 | 20 6f 66 20 74 68 65 20 |he right| of the |
|00002040| 6c 61 73 74 20 63 6f 6c | 6f 6e 20 69 6e 20 74 68 |last col|on in th|
|00002050| 65 20 70 61 74 68 2e 0d | 09 0d 09 65 78 61 6d 70 |e path..|...examp|
|00002060| 6c 65 3a 20 22 57 6f 72 | 6b 20 44 69 73 6b 20 23 |le: "Wor|k Disk #|
|00002070| 31 3a 4d 4f 52 45 20 57 | 6f 72 6b 3a 53 74 61 74 |1:MORE W|ork:Stat|
|00002080| 75 73 20 43 65 6e 74 65 | 72 22 20 72 65 74 75 72 |us Cente|r" retur|
|00002090| 6e 73 20 22 53 74 61 74 | 75 73 20 43 65 6e 74 65 |ns "Stat|us Cente|
|000020a0| 72 22 2e 0d 09 2a 2f 0d | 09 0d 09 62 69 67 73 74 |r"...*/.|...bigst|
|000020b0| 72 69 6e 67 20 62 73 3b | 0d 09 73 68 6f 72 74 20 |ring bs;|..short |
|000020c0| 6c 65 6e 3b 0d 09 62 6f | 6f 6c 65 61 6e 20 66 6c |len;..bo|olean fl|
|000020d0| 70 75 73 68 63 6f 6c 6f | 6e 20 3d 20 66 61 6c 73 |pushcolo|n = fals|
|000020e0| 65 3b 0d 09 0d 09 63 6f | 70 79 73 74 72 69 6e 67 |e;....co|pystring|
|000020f0| 20 28 70 61 74 68 2c 20 | 62 73 29 3b 20 2f 2a 77 | (path, |bs); /*w|
|00002100| 6f 72 6b 20 6f 6e 20 61 | 20 63 6f 70 79 2c 20 77 |ork on a| copy, w|
|00002110| 65 20 6d 69 67 68 74 20 | 6d 6f 64 69 66 79 20 69 |e might |modify i|
|00002120| 74 2a 2f 0d 09 0d 09 6c | 65 6e 20 3d 20 73 74 72 |t*/....l|en = str|
|00002130| 69 6e 67 6c 65 6e 67 74 | 68 20 28 62 73 29 3b 0d |inglengt|h (bs);.|
|00002140| 09 0d 09 69 66 20 28 6c | 65 6e 20 3c 3d 20 30 29 |...if (l|en <= 0)|
|00002150| 20 7b 0d 09 0d 09 09 73 | 65 74 73 74 72 69 6e 67 | {.....s|etstring|
|00002160| 6c 65 6e 67 74 68 20 28 | 66 6e 61 6d 65 2c 20 30 |length (|fname, 0|
|00002170| 29 3b 0d 09 0d 09 09 72 | 65 74 75 72 6e 20 28 74 |);.....r|eturn (t|
|00002180| 72 75 65 29 3b 0d 09 09 | 7d 0d 09 09 0d 09 69 66 |rue);...|}.....if|
|00002190| 20 28 62 73 20 5b 6c 65 | 6e 5d 20 3d 3d 20 27 3a | (bs [le|n] == ':|
|000021a0| 27 29 20 7b 0d 09 0d 09 | 09 73 65 74 73 74 72 69 |') {....|.setstri|
|000021b0| 6e 67 6c 65 6e 67 74 68 | 20 28 62 73 2c 20 6c 65 |nglength| (bs, le|
|000021c0| 6e 20 2d 20 31 29 3b 0d | 09 09 0d 09 09 66 6c 70 |n - 1);.|.....flp|
|000021d0| 75 73 68 63 6f 6c 6f 6e | 20 3d 20 74 72 75 65 3b |ushcolon| = true;|
|000021e0| 0d 09 09 7d 0d 09 0d 09 | 6c 61 73 74 77 6f 72 64 |...}....|lastword|
|000021f0| 20 28 62 73 2c 20 27 3a | 27 2c 20 66 6e 61 6d 65 | (bs, ':|', fname|
|00002200| 29 3b 0d 09 0d 09 69 66 | 20 28 66 6c 70 75 73 68 |);....if| (flpush|
|00002210| 63 6f 6c 6f 6e 29 0d 09 | 09 70 75 73 68 63 68 61 |colon)..|.pushcha|
|00002220| 72 20 28 27 3a 27 2c 20 | 66 6e 61 6d 65 29 3b 0d |r (':', |fname);.|
|00002230| 09 09 0d 09 72 65 74 75 | 72 6e 20 28 74 72 75 65 |....retu|rn (true|
|00002240| 29 3b 0d 09 7d 20 2f 2a | 66 69 6c 65 66 72 6f 6d |);..} /*|filefrom|
|00002250| 70 61 74 68 2a 2f 0d 09 | 0d 09 0d 62 6f 6f 6c 65 |path*/..|...boole|
|00002260| 61 6e 20 66 6f 6c 64 65 | 72 66 72 6f 6d 70 61 74 |an folde|rfrompat|
|00002270| 68 20 28 70 61 74 68 2c | 20 66 6f 6c 64 65 72 29 |h (path,| folder)|
|00002280| 20 62 69 67 73 74 72 69 | 6e 67 20 70 61 74 68 2c | bigstri|ng path,|
|00002290| 20 66 6f 6c 64 65 72 3b | 20 7b 0d 09 0d 09 2f 2a | folder;| {..../*|
|000022a0| 0d 09 72 65 74 75 72 6e | 20 61 6c 6c 20 74 68 65 |..return| all the|
|000022b0| 20 63 68 61 72 61 63 74 | 65 72 73 20 74 6f 20 74 | charact|ers to t|
|000022c0| 68 65 20 6c 65 66 74 20 | 6f 66 20 74 68 65 20 63 |he left |of the c|
|000022d0| 6f 6c 6f 6e 2c 20 61 6e | 64 20 74 68 65 20 63 6f |olon, an|d the co|
|000022e0| 6c 6f 6e 2e 0d 09 0d 09 | 65 78 61 6d 70 6c 65 3a |lon.....|example:|
|000022f0| 20 22 57 6f 72 6b 20 44 | 69 73 6b 20 23 31 3a 4d | "Work D|isk #1:M|
|00002300| 4f 52 45 20 57 6f 72 6b | 3a 53 74 61 74 75 73 20 |ORE Work|:Status |
|00002310| 43 65 6e 74 65 72 22 20 | 72 65 74 75 72 6e 73 20 |Center" |returns |
|00002320| 22 57 6f 72 6b 20 44 69 | 73 6b 20 23 31 3a 4d 4f |"Work Di|sk #1:MO|
|00002330| 52 45 20 57 6f 72 6b 3a | 22 2e 0d 09 2a 2f 0d 09 |RE Work:|"...*/..|
|00002340| 0d 09 62 69 67 73 74 72 | 69 6e 67 20 62 73 3b 0d |..bigstr|ing bs;.|
|00002350| 09 0d 09 6c 61 73 74 77 | 6f 72 64 20 28 70 61 74 |...lastw|ord (pat|
|00002360| 68 2c 20 27 3a 27 2c 20 | 62 73 29 3b 20 2f 2a 6b |h, ':', |bs); /*k|
|00002370| 69 6e 64 20 6f 66 20 69 | 6e 65 66 66 69 63 69 65 |ind of i|nefficie|
|00002380| 6e 74 2c 20 62 75 74 20 | 65 6e 73 75 72 65 73 20 |nt, but |ensures |
|00002390| 73 79 6d 6d 65 74 72 79 | 2a 2f 0d 09 0d 09 63 6f |symmetry|*/....co|
|000023a0| 70 79 73 74 72 69 6e 67 | 20 28 70 61 74 68 2c 20 |pystring| (path, |
|000023b0| 66 6f 6c 64 65 72 29 3b | 0d 09 0d 09 73 65 74 73 |folder);|....sets|
|000023c0| 74 72 69 6e 67 6c 65 6e | 67 74 68 20 28 66 6f 6c |tringlen|gth (fol|
|000023d0| 64 65 72 2c 20 73 74 72 | 69 6e 67 6c 65 6e 67 74 |der, str|inglengt|
|000023e0| 68 20 28 66 6f 6c 64 65 | 72 29 20 2d 20 73 74 72 |h (folde|r) - str|
|000023f0| 69 6e 67 6c 65 6e 67 74 | 68 20 28 62 73 29 29 3b |inglengt|h (bs));|
|00002400| 0d 09 0d 09 72 65 74 75 | 72 6e 20 28 74 72 75 65 |....retu|rn (true|
|00002410| 29 3b 0d 09 7d 20 2f 2a | 66 6f 6c 64 65 72 66 72 |);..} /*|folderfr|
|00002420| 6f 6d 70 61 74 68 2a 2f | 0d 09 0d 09 0d 62 6f 6f |ompath*/|.....boo|
|00002430| 6c 65 61 6e 20 70 61 74 | 68 74 6f 66 69 6c 65 69 |lean pat|htofilei|
|00002440| 6e 66 6f 20 28 70 61 74 | 68 2c 20 66 6e 61 6d 65 |nfo (pat|h, fname|
|00002450| 2c 20 76 6e 75 6d 29 20 | 62 69 67 73 74 72 69 6e |, vnum) |bigstrin|
|00002460| 67 20 70 61 74 68 2c 20 | 66 6e 61 6d 65 3b 20 73 |g path, |fname; s|
|00002470| 68 6f 72 74 20 2a 76 6e | 75 6d 3b 20 7b 0d 09 0d |hort *vn|um; {...|
|00002480| 09 2f 2a 0d 09 63 6f 6e | 76 65 72 74 20 61 20 4d |./*..con|vert a M|
|00002490| 61 63 69 6e 74 6f 73 68 | 20 66 69 6c 65 20 70 61 |acintosh| file pa|
|000024a0| 74 68 20 69 6e 74 6f 20 | 61 20 66 69 6c 65 20 6e |th into |a file n|
|000024b0| 61 6d 65 20 61 6e 64 20 | 61 20 76 6f 6c 75 6d 65 |ame and |a volume|
|000024c0| 20 6e 75 6d 62 65 72 2e | 0d 09 0d 09 77 65 20 61 | number.|....we a|
|000024d0| 6c 73 6f 20 67 65 74 20 | 74 68 65 20 64 69 72 65 |lso get |the dire|
|000024e0| 63 74 6f 72 79 20 69 64 | 20 6f 66 20 74 68 65 20 |ctory id| of the |
|000024f0| 70 61 72 65 6e 74 20 64 | 69 72 65 63 74 6f 72 79 |parent d|irectory|
|00002500| 2c 20 70 72 69 6d 61 72 | 69 6c 79 20 62 65 63 61 |, primar|ily beca|
|00002510| 75 73 65 20 77 65 0d 09 | 68 61 76 65 20 74 68 65 |use we..|have the|
|00002520| 20 63 6f 64 65 20 68 65 | 72 65 2c 20 69 74 20 73 | code he|re, it s|
|00002530| 75 70 70 6f 73 65 64 6c | 79 20 77 6f 72 6b 73 2c |upposedl|y works,|
|00002540| 20 61 6e 64 20 77 65 20 | 6d 69 67 68 74 20 6e 65 | and we |might ne|
|00002550| 65 64 20 69 74 20 73 6f | 6d 65 64 61 79 2e 0d 09 |ed it so|meday...|
|00002560| 2a 2f 0d 09 0d 09 43 49 | 6e 66 6f 50 42 52 65 63 |*/....CI|nfoPBRec|
|00002570| 20 70 62 3b 0d 09 62 69 | 67 73 74 72 69 6e 67 20 | pb;..bi|gstring |
|00002580| 66 6f 6c 64 65 72 3b 0d | 09 6c 6f 6e 67 20 69 64 |folder;.|.long id|
|00002590| 70 61 72 65 6e 74 3b 0d | 09 0d 09 69 66 20 28 21 |parent;.|...if (!|
|000025a0| 66 69 6c 65 70 61 72 73 | 65 76 6f 6c 6e 61 6d 65 |filepars|evolname|
|000025b0| 20 28 70 61 74 68 2c 20 | 76 6e 75 6d 29 29 20 2f | (path, |vnum)) /|
|000025c0| 2a 6e 6f 20 76 6f 6c 75 | 6d 65 20 73 70 65 63 69 |*no volu|me speci|
|000025d0| 66 69 65 64 2a 2f 0d 09 | 09 72 65 74 75 72 6e 20 |fied*/..|.return |
|000025e0| 28 66 61 6c 73 65 29 3b | 0d 09 0d 09 66 6f 6c 64 |(false);|....fold|
|000025f0| 65 72 66 72 6f 6d 70 61 | 74 68 20 28 70 61 74 68 |erfrompa|th (path|
|00002600| 2c 20 66 6f 6c 64 65 72 | 29 3b 0d 09 0d 09 66 69 |, folder|);....fi|
|00002610| 6c 65 66 72 6f 6d 70 61 | 74 68 20 28 70 61 74 68 |lefrompa|th (path|
|00002620| 2c 20 66 6e 61 6d 65 29 | 3b 0d 09 0d 09 63 6c 65 |, fname)|;....cle|
|00002630| 61 72 62 79 74 65 73 20 | 28 26 70 62 2c 20 6c 6f |arbytes |(&pb, lo|
|00002640| 6e 67 73 69 7a 65 6f 66 | 20 28 70 62 29 29 3b 0d |ngsizeof| (pb));.|
|00002650| 09 0d 09 70 62 2e 64 69 | 72 49 6e 66 6f 2e 69 6f |...pb.di|rInfo.io|
|00002660| 4e 61 6d 65 50 74 72 20 | 3d 20 66 6f 6c 64 65 72 |NamePtr |= folder|
|00002670| 3b 0d 09 0d 09 69 66 20 | 28 50 42 47 65 74 43 61 |;....if |(PBGetCa|
|00002680| 74 49 6e 66 6f 20 28 26 | 70 62 2c 66 61 6c 73 65 |tInfo (&|pb,false|
|00002690| 29 20 21 3d 20 6e 6f 45 | 72 72 29 0d 09 09 72 65 |) != noE|rr)...re|
|000026a0| 74 75 72 6e 20 28 66 61 | 6c 73 65 29 3b 0d 09 0d |turn (fa|lse);...|
|000026b0| 09 69 66 20 28 42 69 74 | 54 73 74 20 28 26 70 62 |.if (Bit|Tst (&pb|
|000026c0| 2e 68 46 69 6c 65 49 6e | 66 6f 2e 69 6f 46 6c 41 |.hFileIn|fo.ioFlA|
|000026d0| 74 74 72 69 62 2c 20 33 | 29 29 20 2f 2a 69 74 27 |ttrib, 3|)) /*it'|
|000026e0| 73 20 61 20 66 6f 6c 64 | 65 72 2a 2f 0d 09 09 69 |s a fold|er*/...i|
|000026f0| 64 70 61 72 65 6e 74 20 | 3d 20 70 62 2e 64 69 72 |dparent |= pb.dir|
|00002700| 49 6e 66 6f 2e 69 6f 44 | 72 44 69 72 49 44 3b 0d |Info.ioD|rDirID;.|
|00002710| 09 65 6c 73 65 0d 09 09 | 69 64 70 61 72 65 6e 74 |.else...|idparent|
|00002720| 20 3d 20 70 62 2e 68 46 | 69 6c 65 49 6e 66 6f 2e | = pb.hF|ileInfo.|
|00002730| 69 6f 46 6c 50 61 72 49 | 44 3b 0d 09 0d 09 72 65 |ioFlParI|D;....re|
|00002740| 74 75 72 6e 20 28 74 72 | 75 65 29 3b 0d 09 7d 20 |turn (tr|ue);..} |
|00002750| 2f 2a 70 61 74 68 74 6f | 66 69 6c 65 69 6e 66 6f |/*pathto|fileinfo|
|00002760| 2a 2f 0d 09 0d 09 0d 62 | 6f 6f 6c 65 61 6e 20 64 |*/.....b|oolean d|
|00002770| 69 72 65 63 74 6f 72 79 | 74 6f 70 61 74 68 20 28 |irectory|topath (|
|00002780| 6c 6f 6e 67 20 44 69 72 | 49 44 2c 20 73 68 6f 72 |long Dir|ID, shor|
|00002790| 74 20 76 6e 75 6d 2c 20 | 62 69 67 73 74 72 69 6e |t vnum, |bigstrin|
|000027a0| 67 20 70 61 74 68 29 20 | 7b 0d 09 0d 09 43 49 6e |g path) |{....CIn|
|000027b0| 66 6f 50 42 52 65 63 20 | 62 6c 6f 63 6b 3b 0d 09 |foPBRec |block;..|
|000027c0| 62 69 67 73 74 72 69 6e | 67 20 62 73 64 69 72 65 |bigstrin|g bsdire|
|000027d0| 63 74 6f 72 79 3b 0d 09 | 4f 53 45 72 72 20 65 72 |ctory;..|OSErr er|
|000027e0| 72 63 6f 64 65 3b 0d 09 | 0d 09 73 65 74 65 6d 70 |rcode;..|..setemp|
|000027f0| 74 79 73 74 72 69 6e 67 | 20 28 70 61 74 68 29 3b |tystring| (path);|
|00002800| 0d 09 0d 09 63 6c 65 61 | 72 62 79 74 65 73 20 28 |....clea|rbytes (|
|00002810| 26 62 6c 6f 63 6b 2c 20 | 6c 6f 6e 67 73 69 7a 65 |&block, |longsize|
|00002820| 6f 66 20 28 62 6c 6f 63 | 6b 29 29 3b 0d 09 0d 09 |of (bloc|k));....|
|00002830| 62 6c 6f 63 6b 2e 64 69 | 72 49 6e 66 6f 2e 69 6f |block.di|rInfo.io|
|00002840| 4e 61 6d 65 50 74 72 20 | 3d 20 62 73 64 69 72 65 |NamePtr |= bsdire|
|00002850| 63 74 6f 72 79 3b 0d 09 | 0d 09 62 6c 6f 63 6b 2e |ctory;..|..block.|
|00002860| 64 69 72 49 6e 66 6f 2e | 69 6f 44 72 50 61 72 49 |dirInfo.|ioDrParI|
|00002870| 44 20 3d 20 44 69 72 49 | 44 3b 0d 09 0d 09 64 6f |D = DirI|D;....do|
|00002880| 20 7b 0d 09 09 62 6c 6f | 63 6b 2e 64 69 72 49 6e | {...blo|ck.dirIn|
|00002890| 66 6f 2e 69 6f 56 52 65 | 66 4e 75 6d 20 3d 20 76 |fo.ioVRe|fNum = v|
|000028a0| 6e 75 6d 3b 0d 09 09 0d | 09 09 62 6c 6f 63 6b 2e |num;....|..block.|
|000028b0| 64 69 72 49 6e 66 6f 2e | 69 6f 46 44 69 72 49 6e |dirInfo.|ioFDirIn|
|000028c0| 64 65 78 20 3d 20 2d 31 | 3b 0d 09 09 0d 09 09 62 |dex = -1|;......b|
|000028d0| 6c 6f 63 6b 2e 64 69 72 | 49 6e 66 6f 2e 69 6f 44 |lock.dir|Info.ioD|
|000028e0| 72 44 69 72 49 44 20 3d | 20 62 6c 6f 63 6b 2e 64 |rDirID =| block.d|
|000028f0| 69 72 49 6e 66 6f 2e 69 | 6f 44 72 50 61 72 49 44 |irInfo.i|oDrParID|
|00002900| 3b 0d 09 09 0d 09 09 65 | 72 72 63 6f 64 65 20 3d |;......e|rrcode =|
|00002910| 20 50 42 47 65 74 43 61 | 74 49 6e 66 6f 28 26 62 | PBGetCa|tInfo(&b|
|00002920| 6c 6f 63 6b 2c 66 61 6c | 73 65 29 3b 0d 09 09 0d |lock,fal|se);....|
|00002930| 09 09 69 66 20 28 65 72 | 72 63 6f 64 65 20 21 3d |..if (er|rcode !=|
|00002940| 20 6e 6f 45 72 72 29 0d | 09 09 09 72 65 74 75 72 | noErr).|...retur|
|00002950| 6e 20 28 66 61 6c 73 65 | 29 3b 0d 09 09 0d 09 09 |n (false|);......|
|00002960| 69 66 20 28 21 70 75 73 | 68 63 68 61 72 20 28 27 |if (!pus|hchar ('|
|00002970| 3a 27 2c 20 62 73 64 69 | 72 65 63 74 6f 72 79 29 |:', bsdi|rectory)|
|00002980| 29 0d 09 09 09 72 65 74 | 75 72 6e 20 28 66 61 6c |)....ret|urn (fal|
|00002990| 73 65 29 3b 0d 09 09 09 | 0d 09 09 69 66 20 28 21 |se);....|...if (!|
|000029a0| 70 75 73 68 73 74 72 69 | 6e 67 20 28 70 61 74 68 |pushstri|ng (path|
|000029b0| 2c 20 62 73 64 69 72 65 | 63 74 6f 72 79 29 29 0d |, bsdire|ctory)).|
|000029c0| 09 09 09 72 65 74 75 72 | 6e 20 28 66 61 6c 73 65 |...retur|n (false|
|000029d0| 29 3b 0d 09 09 0d 09 09 | 63 6f 70 79 73 74 72 69 |);......|copystri|
|000029e0| 6e 67 20 28 62 73 64 69 | 72 65 63 74 6f 72 79 2c |ng (bsdi|rectory,|
|000029f0| 20 70 61 74 68 29 3b 0d | 09 09 7d 20 77 68 69 6c | path);.|..} whil|
|00002a00| 65 20 28 62 6c 6f 63 6b | 2e 64 69 72 49 6e 66 6f |e (block|.dirInfo|
|00002a10| 2e 69 6f 44 72 44 69 72 | 49 44 20 21 3d 20 66 73 |.ioDrDir|ID != fs|
|00002a20| 52 74 44 69 72 49 44 29 | 3b 0d 09 0d 09 72 65 74 |RtDirID)|;....ret|
|00002a30| 75 72 6e 20 28 74 72 75 | 65 29 3b 0d 09 7d 20 2f |urn (tru|e);..} /|
|00002a40| 2a 64 69 72 65 63 74 6f | 72 79 74 6f 70 61 74 68 |*directo|rytopath|
|00002a50| 2a 2f 0d 0d 0d 73 74 61 | 74 69 63 20 62 6f 6f 6c |*/...sta|tic bool|
|00002a60| 65 61 6e 20 50 61 74 68 | 4e 61 6d 65 46 72 6f 6d |ean Path|NameFrom|
|00002a70| 57 44 20 28 6c 6f 6e 67 | 20 76 6e 75 6d 2c 20 62 |WD (long| vnum, b|
|00002a80| 69 67 73 74 72 69 6e 67 | 20 70 61 74 68 29 20 7b |igstring| path) {|
|00002a90| 0d 09 0d 09 2f 2a 0d 09 | 50 42 47 65 74 57 44 49 |..../*..|PBGetWDI|
|00002aa0| 6e 66 6f 20 68 61 73 20 | 61 20 62 75 67 20 75 6e |nfo has |a bug un|
|00002ab0| 64 65 72 20 41 2f 55 58 | 20 31 2e 31 2e 20 20 49 |der A/UX| 1.1. I|
|00002ac0| 66 20 76 6e 75 6d 20 69 | 73 20 61 20 72 65 61 6c |f vnum i|s a real|
|00002ad0| 20 76 6e 75 6d 0d 09 61 | 6e 64 20 6e 6f 74 20 61 | vnum..a|nd not a|
|00002ae0| 20 77 64 52 65 66 4e 75 | 6d 2c 20 74 68 65 6e 20 | wdRefNu|m, then |
|00002af0| 69 74 20 72 65 74 75 72 | 6e 73 20 67 61 72 62 61 |it retur|ns garba|
|00002b00| 67 65 2e 20 20 53 69 6e | 63 65 20 41 2f 55 58 20 |ge. Sin|ce A/UX |
|00002b10| 68 61 73 20 6f 6e 6c 79 | 20 31 0d 09 76 6f 6c 75 |has only| 1..volu|
|00002b20| 6d 65 20 28 69 6e 20 74 | 68 65 20 4d 61 63 69 6e |me (in t|he Macin|
|00002b30| 74 6f 73 68 20 73 65 6e | 73 65 29 20 61 6e 64 20 |tosh sen|se) and |
|00002b40| 6f 6e 6c 79 20 31 20 72 | 6f 6f 74 20 64 69 72 65 |only 1 r|oot dire|
|00002b50| 63 74 6f 72 79 2c 20 74 | 68 69 73 20 63 61 6e 0d |ctory, t|his can.|
|00002b60| 09 6f 63 63 75 72 20 6f | 6e 6c 79 20 77 68 65 6e |.occur o|nly when|
|00002b70| 20 61 20 66 69 6c 65 20 | 68 61 73 20 62 65 65 6e | a file |has been|
|00002b80| 20 73 65 6c 65 63 74 65 | 64 20 69 6e 20 74 68 65 | selecte|d in the|
|00002b90| 20 72 6f 6f 74 20 64 69 | 72 65 63 74 6f 72 79 20 | root di|rectory |
|00002ba0| 28 2f 29 2e 0d 09 53 6f | 20 77 65 20 6c 6f 6f 6b |(/)...So| we look|
|00002bb0| 20 66 6f 72 20 74 68 69 | 73 20 61 6e 64 20 68 61 | for thi|s and ha|
|00002bc0| 72 64 20 63 6f 64 65 20 | 74 68 65 20 44 69 72 49 |rd code |the DirI|
|00002bd0| 44 20 61 6e 64 20 76 6e | 75 6d 2e 20 0d 09 2a 2f |D and vn|um. ..*/|
|00002be0| 0d 09 0d 09 57 44 50 42 | 52 65 63 20 62 6c 6f 63 |....WDPB|Rec bloc|
|00002bf0| 6b 3b 0d 09 0d 09 63 6c | 65 61 72 62 79 74 65 73 |k;....cl|earbytes|
|00002c00| 20 28 26 62 6c 6f 63 6b | 2c 20 6c 6f 6e 67 73 69 | (&block|, longsi|
|00002c10| 7a 65 6f 66 20 28 62 6c | 6f 63 6b 29 29 3b 0d 09 |zeof (bl|ock));..|
|00002c20| 0d 09 62 6c 6f 63 6b 2e | 69 6f 56 52 65 66 4e 75 |..block.|ioVRefNu|
|00002c30| 6d 20 3d 20 76 6e 75 6d | 3b 0d 09 0d 09 50 42 47 |m = vnum|;....PBG|
|00002c40| 65 74 57 44 49 6e 66 6f | 20 28 26 62 6c 6f 63 6b |etWDInfo| (&block|
|00002c50| 2c 66 61 6c 73 65 29 3b | 0d 09 0d 09 72 65 74 75 |,false);|....retu|
|00002c60| 72 6e 20 28 64 69 72 65 | 63 74 6f 72 79 74 6f 70 |rn (dire|ctorytop|
|00002c70| 61 74 68 20 28 62 6c 6f | 63 6b 2e 69 6f 57 44 44 |ath (blo|ck.ioWDD|
|00002c80| 69 72 49 44 2c 62 6c 6f | 63 6b 2e 69 6f 57 44 56 |irID,blo|ck.ioWDV|
|00002c90| 52 65 66 4e 75 6d 2c 70 | 61 74 68 29 29 3b 0d 09 |RefNum,p|ath));..|
|00002ca0| 7d 20 2f 2a 50 61 74 68 | 4e 61 6d 65 46 72 6f 6d |} /*Path|NameFrom|
|00002cb0| 57 44 2a 2f 0d 09 0d 09 | 0d 62 6f 6f 6c 65 61 6e |WD*/....|.boolean|
|00002cc0| 20 66 69 6c 65 69 6e 66 | 6f 74 6f 70 61 74 68 20 | fileinf|otopath |
|00002cd0| 28 62 69 67 73 74 72 69 | 6e 67 20 66 6e 61 6d 65 |(bigstri|ng fname|
|00002ce0| 2c 20 73 68 6f 72 74 20 | 76 6e 75 6d 2c 20 62 69 |, short |vnum, bi|
|00002cf0| 67 73 74 72 69 6e 67 20 | 70 61 74 68 29 20 7b 0d |gstring |path) {.|
|00002d00| 09 0d 09 73 65 74 65 6d | 70 74 79 73 74 72 69 6e |...setem|ptystrin|
|00002d10| 67 20 28 70 61 74 68 29 | 3b 0d 09 09 0d 09 69 66 |g (path)|;.....if|
|00002d20| 20 28 21 50 61 74 68 4e | 61 6d 65 46 72 6f 6d 57 | (!PathN|ameFromW|
|00002d30| 44 20 28 28 6c 6f 6e 67 | 29 20 76 6e 75 6d 2c 20 |D ((long|) vnum, |
|00002d40| 70 61 74 68 29 29 20 0d | 09 09 72 65 74 75 72 6e |path)) .|..return|
|00002d50| 20 28 66 61 6c 73 65 29 | 3b 0d 09 09 0d 09 70 75 | (false)|;.....pu|
|00002d60| 73 68 73 74 72 69 6e 67 | 20 28 66 6e 61 6d 65 2c |shstring| (fname,|
|00002d70| 20 70 61 74 68 29 3b 0d | 09 0d 09 72 65 74 75 72 | path);.|...retur|
|00002d80| 6e 20 28 74 72 75 65 29 | 3b 0d 09 7d 20 2f 2a 66 |n (true)|;..} /*f|
|00002d90| 69 6c 65 69 6e 66 6f 74 | 6f 70 61 74 68 2a 2f 0d |ileinfot|opath*/.|
|00002da0| 09 0d 09 0d 73 74 61 74 | 69 63 20 73 66 63 61 6c |....stat|ic sfcal|
|00002db0| 6c 62 61 63 6b 20 73 66 | 67 6c 6f 62 61 6c 66 69 |lback sf|globalfi|
|00002dc0| 6c 74 65 72 20 3d 20 6e | 69 6c 3b 0d 0d 0d 73 74 |lter = n|il;...st|
|00002dd0| 61 74 69 63 20 70 61 73 | 63 61 6c 20 42 6f 6f 6c |atic pas|cal Bool|
|00002de0| 65 61 6e 20 73 66 66 69 | 6c 74 65 72 20 28 43 49 |ean sffi|lter (CI|
|00002df0| 6e 66 6f 50 42 52 65 63 | 20 2a 70 62 29 20 7b 0d |nfoPBRec| *pb) {.|
|00002e00| 09 0d 09 2f 2a 0d 09 69 | 66 20 77 65 20 72 65 74 |.../*..i|f we ret|
|00002e10| 75 72 6e 20 74 72 75 65 | 2c 20 74 68 65 20 66 69 |urn true|, the fi|
|00002e20| 6c 65 20 69 73 20 66 69 | 6c 74 65 72 65 64 2c 20 |le is fi|ltered, |
|00002e30| 6d 65 61 6e 69 6e 67 20 | 69 74 20 69 73 20 6e 6f |meaning |it is no|
|00002e40| 74 20 69 6e 63 6c 75 64 | 65 64 20 69 6e 20 74 68 |t includ|ed in th|
|00002e50| 65 0d 09 73 74 61 6e 64 | 61 72 64 20 66 69 6c 65 |e..stand|ard file|
|00002e60| 20 64 69 61 6c 6f 67 20 | 6c 69 73 74 2e 0d 09 2a | dialog |list...*|
|00002e70| 2f 0d 09 0d 09 74 79 66 | 69 6c 65 69 6e 66 6f 20 |/....tyf|ileinfo |
|00002e80| 69 6e 66 6f 3b 0d 09 0d | 09 69 66 20 28 73 66 67 |info;...|.if (sfg|
|00002e90| 6c 6f 62 61 6c 66 69 6c | 74 65 72 20 3d 3d 20 6e |lobalfil|ter == n|
|00002ea0| 69 6c 29 0d 09 09 72 65 | 74 75 72 6e 20 28 2d 31 |il)...re|turn (-1|
|00002eb0| 29 3b 0d 09 09 0d 09 63 | 6c 65 61 72 62 79 74 65 |);.....c|learbyte|
|00002ec0| 73 20 28 26 69 6e 66 6f | 2c 20 6c 6f 6e 67 73 69 |s (&info|, longsi|
|00002ed0| 7a 65 6f 66 20 28 74 79 | 66 69 6c 65 69 6e 66 6f |zeof (ty|fileinfo|
|00002ee0| 29 29 3b 20 2f 2a 69 6e | 69 74 20 61 6c 6c 20 66 |)); /*in|it all f|
|00002ef0| 69 65 6c 64 73 20 74 6f | 20 7a 65 72 6f 2a 2f 0d |ields to| zero*/.|
|00002f00| 09 0d 09 63 6f 70 79 73 | 74 72 69 6e 67 20 28 28 |...copys|tring ((|
|00002f10| 2a 70 62 29 2e 68 46 69 | 6c 65 49 6e 66 6f 2e 69 |*pb).hFi|leInfo.i|
|00002f20| 6f 4e 61 6d 65 50 74 72 | 2c 20 69 6e 66 6f 2e 66 |oNamePtr|, info.f|
|00002f30| 6e 61 6d 65 29 3b 0d 09 | 0d 09 67 65 74 69 6e 66 |name);..|..getinf|
|00002f40| 6f 66 72 6f 6d 70 62 20 | 28 70 62 2c 20 26 69 6e |ofrompb |(pb, &in|
|00002f50| 66 6f 29 3b 0d 09 0d 09 | 69 66 20 28 28 2a 73 66 |fo);....|if ((*sf|
|00002f60| 67 6c 6f 62 61 6c 66 69 | 6c 74 65 72 29 20 28 26 |globalfi|lter) (&|
|00002f70| 69 6e 66 6f 29 29 0d 09 | 09 72 65 74 75 72 6e 20 |info))..|.return |
|00002f80| 28 2d 31 29 3b 0d 09 09 | 0d 09 72 65 74 75 72 6e |(-1);...|..return|
|00002f90| 20 28 30 29 3b 0d 09 7d | 20 2f 2a 73 66 66 69 6c | (0);..}| /*sffil|
|00002fa0| 74 65 72 2a 2f 0d 0d 09 | 0d 62 6f 6f 6c 65 61 6e |ter*/...|.boolean|
|00002fb0| 20 73 66 64 69 61 6c 6f | 67 20 28 62 6f 6f 6c 65 | sfdialo|g (boole|
|00002fc0| 61 6e 20 66 6c 70 75 74 | 2c 20 62 69 67 73 74 72 |an flput|, bigstr|
|00002fd0| 69 6e 67 20 66 6e 61 6d | 65 2c 20 73 68 6f 72 74 |ing fnam|e, short|
|00002fe0| 20 2a 76 6e 75 6d 2c 20 | 73 66 63 61 6c 6c 62 61 | *vnum, |sfcallba|
|00002ff0| 63 6b 20 66 69 6c 74 65 | 72 70 72 6f 63 2c 20 4f |ck filte|rproc, O|
|00003000| 53 54 79 70 65 20 66 69 | 6c 65 74 79 70 65 29 20 |SType fi|letype) |
|00003010| 7b 0d 09 0d 09 72 65 67 | 69 73 74 65 72 20 44 69 |{....reg|ister Di|
|00003020| 61 6c 6f 67 54 48 6e 64 | 6c 20 68 64 69 61 6c 6f |alogTHnd|l hdialo|
|00003030| 67 3b 0d 09 72 65 67 69 | 73 74 65 72 20 73 68 6f |g;..regi|ster sho|
|00003040| 72 74 20 69 64 3b 0d 09 | 52 65 63 74 20 72 2c 20 |rt id;..|Rect r, |
|00003050| 72 73 63 72 65 65 6e 3b | 0d 09 50 6f 69 6e 74 20 |rscreen;|..Point |
|00003060| 70 74 3b 0d 09 53 46 52 | 65 70 6c 79 20 72 65 70 |pt;..SFR|eply rep|
|00003070| 6c 79 3b 0d 09 53 46 54 | 79 70 65 4c 69 73 74 20 |ly;..SFT|ypeList |
|00003080| 74 79 70 65 73 72 65 63 | 3b 0d 0d 09 63 6f 6d 65 |typesrec|;...come|
|00003090| 74 6f 66 72 6f 6e 74 20 | 28 29 3b 0d 09 0d 09 61 |tofront |();....a|
|000030a0| 72 72 6f 77 63 75 72 73 | 6f 72 20 28 29 3b 0d 09 |rrowcurs|or ();..|
|000030b0| 0d 09 69 66 20 28 66 6c | 70 75 74 29 0d 09 09 69 |..if (fl|put)...i|
|000030c0| 64 20 3d 20 67 65 74 44 | 6c 67 49 44 3b 0d 09 65 |d = getD|lgID;..e|
|000030d0| 6c 73 65 0d 09 09 69 64 | 20 3d 20 70 75 74 44 6c |lse...id| = putDl|
|000030e0| 67 49 44 3b 0d 09 09 0d | 09 68 64 69 61 6c 6f 67 |gID;....|.hdialog|
|000030f0| 20 3d 20 28 44 69 61 6c | 6f 67 54 48 6e 64 6c 29 | = (Dial|ogTHndl)|
|00003100| 20 47 65 74 52 65 73 6f | 75 72 63 65 20 28 27 44 | GetReso|urce ('D|
|00003110| 4c 4f 47 27 2c 20 69 64 | 29 3b 0d 09 0d 09 69 66 |LOG', id|);....if|
|00003120| 20 28 68 64 69 61 6c 6f | 67 20 3d 3d 20 6e 69 6c | (hdialo|g == nil|
|00003130| 29 20 7b 0d 09 09 0d 09 | 09 70 74 2e 68 20 3d 20 |) {.....|.pt.h = |
|00003140| 70 74 2e 76 20 3d 20 38 | 35 3b 0d 09 09 7d 0d 09 |pt.v = 8|5;...}..|
|00003150| 65 6c 73 65 20 7b 0d 09 | 09 72 20 3d 20 28 2a 2a |else {..|.r = (**|
|00003160| 68 64 69 61 6c 6f 67 29 | 2e 62 6f 75 6e 64 73 52 |hdialog)|.boundsR|
|00003170| 65 63 74 3b 0d 09 0d 09 | 09 72 73 63 72 65 65 6e |ect;....|.rscreen|
|00003180| 20 3d 20 71 75 69 63 6b | 64 72 61 77 67 6c 6f 62 | = quick|drawglob|
|00003190| 61 6c 20 28 73 63 72 65 | 65 6e 42 69 74 73 29 2e |al (scre|enBits).|
|000031a0| 62 6f 75 6e 64 73 3b 0d | 09 0d 09 09 70 74 2e 68 |bounds;.|....pt.h|
|000031b0| 20 3d 20 72 73 63 72 65 | 65 6e 2e 6c 65 66 74 20 | = rscre|en.left |
|000031c0| 2b 20 28 28 28 72 73 63 | 72 65 65 6e 2e 72 69 67 |+ (((rsc|reen.rig|
|000031d0| 68 74 20 2d 20 72 73 63 | 72 65 65 6e 2e 6c 65 66 |ht - rsc|reen.lef|
|000031e0| 74 29 20 2d 20 28 72 2e | 72 69 67 68 74 20 2d 20 |t) - (r.|right - |
|000031f0| 72 2e 6c 65 66 74 29 29 | 20 2f 20 32 29 3b 0d 09 |r.left))| / 2);..|
|00003200| 0d 09 09 70 74 2e 76 20 | 3d 20 72 73 63 72 65 65 |...pt.v |= rscree|
|00003210| 6e 2e 74 6f 70 20 2b 20 | 28 28 72 73 63 72 65 65 |n.top + |((rscree|
|00003220| 6e 2e 62 6f 74 74 6f 6d | 20 2d 20 72 73 63 72 65 |n.bottom| - rscre|
|00003230| 65 6e 2e 74 6f 70 29 20 | 2d 20 28 72 2e 62 6f 74 |en.top) |- (r.bot|
|00003240| 74 6f 6d 20 2d 20 72 2e | 74 6f 70 29 29 20 2f 20 |tom - r.|top)) / |
|00003250| 33 3b 0d 09 09 7d 0d 0d | 09 69 66 20 28 66 6c 70 |3;...}..|.if (flp|
|00003260| 75 74 29 0d 09 09 53 46 | 50 75 74 46 69 6c 65 20 |ut)...SF|PutFile |
|00003270| 28 70 74 2c 20 28 70 74 | 72 73 74 72 69 6e 67 29 |(pt, (pt|rstring)|
|00003280| 20 22 5c 70 22 2c 20 66 | 6e 61 6d 65 2c 20 6e 69 | "\p", f|name, ni|
|00003290| 6c 2c 20 26 72 65 70 6c | 79 29 3b 0d 09 09 0d 09 |l, &repl|y);.....|
|000032a0| 65 6c 73 65 20 7b 0d 09 | 09 73 68 6f 72 74 20 63 |else {..|.short c|
|000032b0| 74 66 69 6c 65 73 3b 0d | 09 09 0d 09 09 69 66 20 |tfiles;.|.....if |
|000032c0| 28 66 69 6c 65 74 79 70 | 65 20 3d 3d 20 30 29 20 |(filetyp|e == 0) |
|000032d0| 2f 2a 73 65 74 20 66 69 | 6c 65 74 79 70 65 20 74 |/*set fi|letype t|
|000032e0| 6f 20 30 20 74 6f 20 67 | 65 74 20 61 6c 6c 20 66 |o 0 to g|et all f|
|000032f0| 69 6c 65 73 2a 2f 0d 09 | 09 09 63 74 66 69 6c 65 |iles*/..|..ctfile|
|00003300| 73 20 3d 20 2d 31 3b 0d | 09 09 65 6c 73 65 20 7b |s = -1;.|..else {|
|00003310| 0d 09 09 09 63 74 66 69 | 6c 65 73 20 3d 20 31 3b |....ctfi|les = 1;|
|00003320| 0d 09 09 09 0d 09 09 09 | 74 79 70 65 73 72 65 63 |........|typesrec|
|00003330| 20 5b 30 5d 20 3d 20 66 | 69 6c 65 74 79 70 65 3b | [0] = f|iletype;|
|00003340| 0d 09 09 09 7d 0d 09 09 | 0d 09 09 69 66 20 28 66 |....}...|...if (f|
|00003350| 69 6c 74 65 72 70 72 6f | 63 20 3d 3d 20 6e 69 6c |ilterpro|c == nil|
|00003360| 29 20 7b 0d 09 09 0d 09 | 09 09 53 46 47 65 74 46 |) {.....|..SFGetF|
|00003370| 69 6c 65 20 28 70 74 2c | 20 28 70 74 72 73 74 72 |ile (pt,| (ptrstr|
|00003380| 69 6e 67 29 20 22 5c 70 | 22 2c 20 6e 69 6c 2c 20 |ing) "\p|", nil, |
|00003390| 63 74 66 69 6c 65 73 2c | 20 74 79 70 65 73 72 65 |ctfiles,| typesre|
|000033a0| 63 2c 20 6e 69 6c 2c 20 | 26 72 65 70 6c 79 29 3b |c, nil, |&reply);|
|000033b0| 0d 09 09 09 7d 0d 09 09 | 65 6c 73 65 20 7b 09 0d |....}...|else {..|
|000033c0| 09 09 09 73 66 67 6c 6f | 62 61 6c 66 69 6c 74 65 |...sfglo|balfilte|
|000033d0| 72 20 3d 20 66 69 6c 74 | 65 72 70 72 6f 63 3b 0d |r = filt|erproc;.|
|000033e0| 09 09 0d 09 09 09 53 46 | 47 65 74 46 69 6c 65 20 |......SF|GetFile |
|000033f0| 28 70 74 2c 20 28 70 74 | 72 73 74 72 69 6e 67 29 |(pt, (pt|rstring)|
|00003400| 20 22 5c 70 22 2c 20 28 | 46 69 6c 65 46 69 6c 74 | "\p", (|FileFilt|
|00003410| 65 72 50 72 6f 63 50 74 | 72 29 20 26 73 66 66 69 |erProcPt|r) &sffi|
|00003420| 6c 74 65 72 2c 20 63 74 | 66 69 6c 65 73 2c 20 74 |lter, ct|files, t|
|00003430| 79 70 65 73 72 65 63 2c | 20 6e 69 6c 2c 20 26 72 |ypesrec,| nil, &r|
|00003440| 65 70 6c 79 29 3b 0d 09 | 09 09 7d 0d 09 09 7d 0d |eply);..|..}...}.|
|00003450| 09 09 0d 09 69 66 20 28 | 72 65 70 6c 79 2e 67 6f |....if (|reply.go|
|00003460| 6f 64 29 20 7b 0d 09 0d | 09 09 2a 76 6e 75 6d 20 |od) {...|..*vnum |
|00003470| 3d 20 72 65 70 6c 79 2e | 76 52 65 66 4e 75 6d 3b |= reply.|vRefNum;|
|00003480| 0d 09 09 0d 09 09 63 6f | 70 79 73 74 72 69 6e 67 |......co|pystring|
|00003490| 20 28 72 65 70 6c 79 2e | 66 4e 61 6d 65 2c 20 66 | (reply.|fName, f|
|000034a0| 6e 61 6d 65 29 3b 0d 09 | 09 7d 0d 09 09 0d 09 72 |name);..|.}.....r|
|000034b0| 65 74 75 72 6e 20 28 72 | 65 70 6c 79 2e 67 6f 6f |eturn (r|eply.goo|
|000034c0| 64 29 3b 0d 09 7d 20 2f | 2a 73 66 64 69 61 6c 6f |d);..} /|*sfdialo|
|000034d0| 67 2a 2f 0d 09 20 20 20 | 20 20 20 20 20 0d 20 0d |g*/.. | . .|
|000034e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000034f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003500| 00 00 01 00 00 00 01 88 | 00 00 00 88 00 00 00 46 |........|.......F|
|00003510| 09 00 00 00 20 00 00 00 | 22 00 00 00 00 66 69 6c |.... ...|"....fil|
|00003520| 65 2e 73 65 74 46 75 6c | 6c 56 65 72 73 69 6f 6e |e.setFul|lVersion|
|00003530| 0d 61 70 70 6c 65 74 66 | 69 6c 65 73 2e 63 02 00 |.appletf|iles.c..|
|00003540| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|00003550| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|00003560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003570| 00 00 a9 81 44 c7 00 00 | 00 00 00 00 01 ce 6e 20 |....D...|......n |
|00003580| 79 6f 75 20 77 69 73 68 | 20 74 6f 20 73 65 74 2e |you wish| to set.|
|00003590| 0d 73 74 72 69 6e 67 20 | 69 73 20 74 68 65 20 6e |.string |is the n|
|000035a0| 65 77 20 76 65 72 73 69 | 6f 6e 20 69 6e 66 6f 72 |ew versi|on infor|
|000035b0| 6d 61 74 69 6f 6e 20 66 | 6f 72 20 74 68 65 20 66 |mation f|or the f|
|000035c0| 69 6c 65 20 61 74 20 70 | 61 74 68 2e 00 00 00 81 |ile at p|ath.....|
|000035d0| 00 00 00 37 00 00 00 00 | 43 68 61 6e 67 65 73 20 |...7....|Changes |
|000035e0| 74 68 65 20 66 75 6c 6c | 20 76 65 72 73 69 6f 6e |the full| version|
|000035f0| 20 6f 66 20 74 68 65 20 | 66 69 6c 65 20 61 74 20 | of the |file at |
|00003600| 00 00 00 76 00 03 00 26 | 00 00 2e d7 02 47 00 df |...v...&|.....G..|
|00003610| 9e b0 80 00 01 b3 01 ec | 03 17 03 c1 94 20 00 00 |........|..... ..|
|00003620| 00 00 00 01 00 06 00 40 | 03 2a 70 62 00 2c 00 00 |.......@|.*pb.,..|
|00003630| 01 96 00 16 00 df 9d 10 | 80 00 01 8b 01 e4 02 ef |........|........|
|00003640| 03 b9 94 20 00 00 00 00 | 00 00 0d 70 62 2e 68 46 |... ....|...pb.hF|
|00003650| 69 6c 65 49 6e 66 6f 20 | 00 22 00 00 01 96 00 16 |ileInfo |."......|
|00003660| 00 df 9d 7c 80 00 01 9f | 01 e8 03 03 03 bd 94 20 |...|....|....... |
|00003670| 00 00 00 00 00 00 03 70 | 62 20 00 00 00 0a 00 00 |.......p|b ......|
|00003680| 2e 08 02 3e 00 00 00 00 | 00 00 01 00 00 00 01 88 |...>....|........|
|00003690| 00 00 00 88 00 00 00 46 | 00 d5 c9 c4 14 34 00 00 |.......F|.....4..|
|000036a0| 00 1c 00 46 00 01 44 54 | 56 55 00 00 00 12 42 4b |...F..DT|VU....BK|
|000036b0| 50 54 00 00 00 1e 21 c8 | ff ff 00 00 00 00 00 00 |PT....!.|........|
|000036c0| 00 00 2c c6 ff ff 00 00 | 00 7a 00 00 00 00 00 00 |..,.....|.z......|
|000036d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000036f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+